We are trying to migrate from Solr 3.6.2 to Solr 4.2.1 and are having problems using the properties in the solrcore.properties file in the-config.xml file.
With Solr 3.6.2, we were able to directly use the properties in the solrcore.properties file inside data-config.xml, for example:
<dataSource driver="${jdbc.driver}" url="jdbc:mysql://${jdbc.host}:${jdbc.port}/${db.name}" user="${jdbc.username}" password="${jdbc.password}" batchSize="-1" />
Now these properties are not found, so when I call dataimport, it throws this exception:
Apr 26, 2013 11:10:58 AM org.apache.solr.common.SolrException log SEVERE: Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: Processing Document
If I hardcode the properties in data-config.xml, then the import will work fine.
Both data files-config.xml and solrcore.properties are located under the directory project_name/solr/app-cores/core_name/conf
Then a hint appeared from here and tried to configure the properties in the data import request handler in the solr-config.xml file as follows:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">data-config.xml</str> <str name="jdbcDriver">${jdbc.driver}</str> <str name="jdbcHost">${jdbc.host}</str> <str name="jdbcPort">${jdbc.port}</str> <str name="jdbcUsername">${jdbc.username}</str> <str name="jdbcPassword">${jdbc.password}</str> </lst> </requestHandler>
and use them in data-config.xml, for example {dataimport.jdbcDriver} and {dataimport.request.jdbcDriver} , but they throw the same exception!
How to fix it?
arun
source share