org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.handler.dataimport.DataImportHandler
Asked Answered
N

4

12

I am new for solr. I have installed apache tomcat 7.0 on my server and I have solr 3.6.1 on server.

I have solr-home folder set by network guys on my D:\ drive. The folders in that are: bin,etc,logs,multicore,webapps.

In the multicore folder there are: core0,core1,exampledocs,README.txt and solr.xml. In webapps folder I have solr.war file nothing else.

Now I keep one more core folder in multicore folder named ConfigUserTextUpdate which have conf folder in it and restart the tomcat service and I can see the new core on the localhost/solr.

Now I add db-config.xml to the ConfigUserTextUpdate core. Below is the content:

<dataConfig>
<dataSource
type="JdbcDataSource"
driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://<dbname>\<servername>;databaseName=dbname" user="username"
    password="password"/>
<document>
    <entity name="ConfigUserTextUpdate" query="UserTextUpdate_Index">
    </entity>
</document>
</dataConfig>

Upto here everything is fine and all the three cores are shown on localhost/solr. Now in the solrconfig.xml of the core ConfigUserTextUpdate I add the line

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

And it starts giving the error as shown below:

HTTP Status 500 - Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you

want solr to continue after configuration errors, change: false in solr.xml ------------------------------------------------------------- org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.handler.dataimport.DataImportHandler' at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:394) at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:419) at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:455) at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:159) at org.apache.solr.core.SolrCore.(SolrCore.java:563) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:480) at org.apache.solr.core.CoreContainer.load(CoreContainer.java:332) at org.apache.solr.core.CoreContainer.load(CoreContainer.java:216) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:161) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:96) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.solr.handler.dataimport.DataImportHandler at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.net.FactoryURLClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:378) ... 27 more

I have tried many things as putting the dataimporthandler.jar file in the core folder and other many things given on various sites but still getting the same error. Please help me with these.

Let me know if you need some more information.

Thanks in advance.

Neptune answered 17/12, 2012 at 12:10 Comment(0)
S
28

you have to edit solrconfig.xml and add the path to the library as well, e.g.:

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

..if you still have it in that directory. In the example solrconfigs I found they put it right underneath

<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
Shepley answered 15/1, 2013 at 10:49 Comment(2)
For the solr 4.5.0 example config (example/solr/collection1/conf/solrconfig.xml) this works for me: <lib dir="../../../dist/" regex="solr-dataimporthandler-.*\.jar" />Leiva
I use solr 5.3.0. I added different path and worked. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />Gerta
T
9

In solr-4.3.0 while trying to implement: http://wiki.apache.org/solr/DIHQuickStart adding:

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

in the file: PROJECT-HOME\solr\collection1\ conf\solrconfig.xml

under the existing lines:

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

solved the problem. maybe you need to restart the servlet container (in default case: Jetty).

Tabby answered 9/11, 2013 at 14:2 Comment(0)
P
1

The problem with solr-5.2.0 version. when i switched to solr-5.5.0, The issue has been resolved.

Philae answered 12/5, 2016 at 12:46 Comment(0)
M
0

Had similar problem, my issue was with symlinks (solr didn't follow them).

Mikey answered 19/2, 2014 at 19:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.