2

Hi I'm using the Solr 4 beta, and I'm not a Java programmer. And I'm configuring the DataImportHandler withing the example folder for my MySQL DB. Problem is, when I'm starting the server with:

java -jar start.jar

My solrconfig.xml has this:

<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
 <str name="config">data-config.xml</str>
</lst>
</requestHandler>

From the other thread the advise was to copy apache-solr-solrj-4.0.jar to the lib/ directory, which I did. One only difference is that in the current Solr release, the filename is: apache-solr-solrj-4.0.0-BETA.jar, but I tried to copy it with different names. Also, I added to the solrconfig.xml this line so that SolrJ would be loaded:

<lib dir="/dist/" regex="apache-solr-solrj-*\.jar" />

Nevertheless, I'm still getting the exception:

SEVERE: null:org.apache.solr.common.SolrException: RequestHandler init failure
    at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:168)
.
....
Caused by: java.lang.ClassNotFoundException: org.apache.solr.handler.dataimport.DataImportHandler

3 Answers 3

12

In your solr conf check if you have included the DIH jar, if you haven't then you should add something like below

<lib dir="../../dist/" regex="solr-dataimporthandler-.*\.jar" />
Sign up to request clarification or add additional context in comments.

Comments

2

You need to add the files in \contrib\dataimporthandler\lib and apache-solr-dataimporthandler-4.0.jar from dist folder to your class path.

2 Comments

Well I did export CLASSPATH=/home/my/projects/apache-solr-4.0.0-BETA/dist:/home/my/projects/apache-solr-4.0.0-BETA/contrib/dataimporthandler/lib/ but this didn't help.
But you havent included them in your lib settings i guess? You can also make a lib dir and copy all files into there. Add <lib dir="./lib" /> to solrconfig.xml
0

I apparently did a mistake by trying to use the example folder to import data from MySQL. In this directory there's a fully working example-DIH folder, which just works.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.