Support Questions

Find answers, ask questions, and share your expertise

Solr DataImporter class not found

avatar
Expert Contributor

CDH version : 5.9.2

solr version : 4.10.3

 

I am trying to import Oracle table data to the Solrcloud. I am getting the error when creating the collection with the below command

 

solrctl --zk ${ZOOKEEPER_CONNECT} collection --create xxxx -s 2 

 

Trace:

Caused by: java.lang.ClassNotFoundException: org.apache.solr.handler.dataimport.DataImportHandler

 

so I created the lib folder inside my core instantdir like

 

instantDir/lib and copied jar from the parcel folder

 

/data/opt/cloudera/parcels/CDH-5.9.2-1.cdh5.9.2.p0.3/jars/solr-dataimportandler*.jar

 

But it does not consider those folder jars when i again try to create the collection getting same error.

 

In solrconfig.xml i have below entry for lib tag:

 

<lib dir="../lib" />

 

when i check the solr server log i can see few warns

 

2017-07-24 08:15:31,421 WARN org.apache.solr.core.SolrResourceLoader: Can't find (or read) directory to add to classloader: ../lib (resolved as: /var/lib/solr/xxxx_shard1_replica1/../lib).

 

From my understanding the folder xxxx_shard1_replica1 must be created once the collection are successfully created.

 

But I don't why it is refering it that folder and throwing the error.

 

 

1 ACCEPTED SOLUTION

avatar
Expert Contributor

How about adding a lib configuration to your solrconfig.xml? Like below:

 

<lib dir="/opt/cloudera/parcels/CDH/lib/solr/" regex="solr-dataimporthandler*\.jar" />

 

Also, the dir /var/lib/solr/xxxx_shard1_replica1 is created by solr when the node is asked to load the core, not when the collection is created.

View solution in original post

5 REPLIES 5

avatar
Expert Contributor

How about adding a lib configuration to your solrconfig.xml? Like below:

 

<lib dir="/opt/cloudera/parcels/CDH/lib/solr/" regex="solr-dataimporthandler*\.jar" />

 

Also, the dir /var/lib/solr/xxxx_shard1_replica1 is created by solr when the node is asked to load the core, not when the collection is created.

avatar
Expert Contributor

Yuexin Zhang thank you for your reply 

 

Your solution partially solved my problem. now the collection are created with the below error in the solrAdmin console.

 

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: RequestHandler init failure

 

Solrconfig xml:

 

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

 

I feel like it expected the ojdbc.jar in the classpath. Since I have 5 nodes cluster should i need to copy the ojdbc.jar in all the node of the folder  

/opt/cloudera/parcels/CDH/lib/solr/

 

 

avatar
Expert Contributor

I have copied the ojdbc6.jar to the path 

 

/opt/cloudera/parcels/CDH/lib/solr/

 

in all 5 nodes. still getting the problem in the SolrCore Initialization Failures  error in the solr admin page and also it didn't listing the created collection core in the admin page.

 

Error:

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: RequestHandler init failure

 

 

avatar
Expert Contributor

Problem has been solved. the mistake is mine,previously i have given wrong driver name and url for oracle connection. I have corrected and it successully imported data from oracle.

avatar
Rising Star

Glad the issue the resolved but try to use some other location to store those jars instead of /opt/cloudera/parcels as when you upgrade you can lose all those jars.