title: SOLR DataImport Error "Unable to Execute Query"
body: <p>I have a website running on an Amazon EC2 Instance, and I'm trying to get Solr to interface and work with the database I'm using. I'm able to use the admin interface and have gotten the example xml files indexed, but whenever I try to import one of my database tables, I get the error</p>
  
  <pre><code>SEVERE: Exception while processing: gamelydb document : SolrInputDocument[{}]:org.apache.solr.handler.dataimport.DataImportHandlerException:
   Unable to execute query: SELECT * FROM league Processing Document # 1
  </code></pre>
  
  <p>Here's my data-config.xml file. I also added the dataimporthandler to the solrconfig.xml file.</p>
  
  <pre><code>&lt;dataConfig&gt;
    &lt;dataSource type="JdbcDataSource"
                driver="com.mysql.jdbc.Driver"
                url="jdbc:mysql://www.mysite.com/mydb"
                user="root"
                password="mypassword"/&gt;
    &lt;document&gt;
      &lt;entity name="mydb"
              query="SELECT * FROM league"&gt;
         &lt;field column="id" name="id" /&gt;
         &lt;field column="leaguename" name="leaguename" /&gt;
      &lt;/entity&gt;
    &lt;/document&gt;
  &lt;/dataConfig&gt;
  </code></pre>
  
  <p>Any idea why this is happening? And just let me know if I need to clarify anything.</p>
  
  <p>So I changed the url a bit and removed the 'http://' and that error seemed to go away. However none of the information seems to be searchable through the admin. There are now a few files in the data directory (_1.fnm, _1.frq,...). Here is what solr prints to the log.</p>
  
  <pre><code>Jul 13, 2011 1:19:45 PM org.apache.solr.core.SolrCore execute
  INFO: [] webapp=/solr path=/dataimport params={} status=0 QTime=4
  Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrCore execute
  INFO: [] webapp=/solr path=/dataimport params={command=full-import} status=0 QTime=4
  Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.DataImporter doFullImport
  INFO: Starting Full Import
  Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
  INFO: Read dataimport.properties
  Jul 13, 2011 1:19:48 PM org.apache.solr.update.DirectUpdateHandler2 deleteAll
  INFO: [] REMOVING ALL DOCUMENTS FROM INDEX
  Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrDeletionPolicy onInit
  INFO: SolrDeletionPolicy.onInit: commits:num=1
          commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_2,version=1310405039852,generation=2,filenames=[_0.tis, _0.nrm, _0.fnm, _0.tii, _0.frq, segments_2, _0.fdx, _0.fdt]
  Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrDeletionPolicy updateCommits
  INFO: newest commit = 1310405039852
  Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.JdbcDataSource$1 call
  INFO: Creating a connection for entity gamelydb with URL: jdbc:mysql://www.gamely.us/gamelydb
  Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.JdbcDataSource$1 call
  INFO: Time taken for getConnection(): 667
  Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.DocBuilder finish
  INFO: Import completed successfully
  Jul 13, 2011 1:19:49 PM org.apache.solr.update.DirectUpdateHandler2 commit
  INFO: start commit(optimize=true,waitFlush=false,waitSearcher=true,expungeDeletes=false)
  Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrDeletionPolicy onCommit
  INFO: SolrDeletionPolicy.onCommit: commits:num=2
          commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_2,version=1310405039852,generation=2,filenames=[_0.tis, _0.nrm, _0.fnm, _0.tii, _0.frq, segments_2, _0.fdx, _0.fdt]
          commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_3,version=1310405039855,generation=3,filenames=[_1.fdx, _1.tis, _1.frq, _1.fdt, _1.tii, _1.fnm, _1.nrm, segments_3]
  Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrDeletionPolicy updateCommits
  INFO: newest commit = 1310405039855
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher &lt;init&gt;
  INFO: Opening Searcher@1c4795e main
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
          fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming result for Searcher@1c4795e main
          fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
          filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming result for Searcher@1c4795e main
          filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
          queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=1,evictions=0,size=1,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming result for Searcher@1c4795e main
          queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
          documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
  INFO: autowarming result for Searcher@1c4795e main
          documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.core.QuerySenderListener newSearcher
  INFO: QuerySenderListener sending requests to Searcher@1c4795e main
  Jul 13, 2011 1:19:49 PM org.apache.solr.core.QuerySenderListener newSearcher
  INFO: QuerySenderListener done.
  Jul 13, 2011 1:19:49 PM org.apache.solr.update.DirectUpdateHandler2 commit
  INFO: end_commit_flush
  Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrCore registerSearcher
  INFO: [] Registered new searcher Searcher@1c4795e main
  Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher close
  INFO: Closing Searcher@1d38b87 main
          fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
          filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
          queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=1,evictions=0,size=1,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
          documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
  Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
  INFO: Read dataimport.properties
  Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.SolrWriter persist
  INFO: Wrote last indexed time to /home/ec2-user/public_html/solr/example/solr/./conf/dataimport.properties
  Jul 13, 2011 1:19:49 PM org.apache.solr.update.processor.LogUpdateProcessor finish
  INFO: {deleteByQuery=*:*,add=[9, 10, 11, 12, 13, 14],optimize=} 0 4
  Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.DocBuilder execute
  INFO: Time taken = 0:0:1.66
  </code></pre>
  
  <p>EDIT: If you find something on here that's downvotable, please just let me know so I can fix it.</p>