6

When I added this configuration in solrconfig.xml :

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

then started tomcat, I got this exception :

ClassNotFoundException: org.apache.solr.util.plugin.SolrCoreAware 

I checked the dir

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

jar imported, what's wrong with it? what's the lib node dir attribute mean ?

javanna
  • 59,145
  • 14
  • 144
  • 125
Sally Lou
  • 69
  • 6
  • The SolrCoreAware class is used within Solr itself, so the jar which contains it should be already included in the `solr.war` file, within the `WEB-INF/lib` folder. Did you modify the `solr.war` for some reason? Which version of Solr are you running? – javanna Aug 06 '12 at 07:27
  • @javanna,thank you for your help, I forgot adding "solr-importdata.jar" into solr/WEB-INF/lib,but I added it to tomcat lib, solr cant't find it, so exception throws out. – Sally Lou Aug 07 '12 at 12:25
  • That's even better, you had those jars in different class loaders. The DIH couldn't see solr and solr couldn't see the dih I guess. Glad you solved. – javanna Aug 07 '12 at 14:20

1 Answers1

5

Converting OP's comment into an answer as (a) it's easier to spot and (b) worked for me:

Take care not to place solr-dataimporthandler-x.y.z.jar into

Tomcat\lib                                <-  Doesn't work!

Instead make sure it's placed in:

Tomcat\webapps\solr\WEB-INF\lib           <-  Works.
Jeroen
  • 60,696
  • 40
  • 206
  • 339
  • Hi Jeroen, you seem to have solved this issue for a bunch of folks :) and it looks a bit like my issue, could you have a look please: https://stackoverflow.com/questions/69814085/getting-data-import-handler-to-work-with-solr-8-10-1 – Adam Nov 03 '21 at 12:47
  • Hi Adam, my answer here is from _2014_ and I'm afraid after that year I have never touched Solr again. Good luck with your other question! – Jeroen Nov 03 '21 at 16:36