I have been trying to get Solr DIH working with PostgreSQL for hours now and I cannot find the problem, as the Logger doesn't not tell me anthing helpful. My aim is as simple as to synchronize the data from the database with Solr (using the DIH).
My setup is as follows:
Jetty, Windows 8
solrconfig.xml (nothing changed except for the following)
[...]
<lib dir="../../../../dist/" regex="solr-dataimporthandler-.*\.jar" />
<lib dir="../../../../dist/" regex="sqljdbc4.*\.jar" />
<lib dir="../../../../dist/" regex="postgresql-.*\.jar" />
[...]
data-config.xml
<dataConfig>
<dataSource type="JdbcDataSource"
driver="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/solrdih"
user="solrdih"
password="solrdih"
batchSize="100" />
<document>
<entity name="solrdih"
query="SELECT * FROM myTable">
<field column="id" name="id" />
</entity>
</document>
</dataConfig>
schema.xml (nothing changed except for the following)
[...]
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="name" type="text" indexed="true" stored="true"/>
<field name="description" type="text" indexed="true" stored="true"/>
[...]
Calling http://localhost:8983/solr/solr/dataimport
, I get the following:
It reads:
ERROR DocBuilder Exception while processing: solrdih document : SolrInputDocument[]:org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT * FROM myTable Processing Document # 1
ERROR DataImporter Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT * FROM myTable Processing Document # 1
Could someone please provide hints where to look for the error? Thanks in advance!
So, this error came from all the way down in Postgres and everything works fine since I made changes to pg_hba.conf
host all all 127.0.0.1/32 md5
to
host all all 127.0.0.1/32 trust