Error when start Solr cloud, due to location of 3rd party libraries

柔情痞子 提交于 2019-12-03 03:48:35
Muhannad A.Alhariri

The problem is now solved.

This problem occurred because dataimporthandler and requesthandler are loaded by two different class loaders. To solve it, ensure that solr loads its jars only from the same class loader.

First of all I ensured that :

1) In solrconfig.xml remove ensure that dataimporthandler only comes from one place 2) I have commented all directives and added new one that refers to lib directory in solr directory so the lib directory path is example/solr/lib , this directory doesn't exists by default. Create it (for example using mkdir solr/lib) and the lib directive in solrconfig.xml becomes

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

3) Add the jar file from dist directory to this directory example/solr/lib
4) Fire up your solr server

And don't forget to copy your mysql-driver jar to your include path to be able to index your mysql database tables if you use dataimporthandler for this purpose

Note: This works for solr 4.0

The problem is most probably deeper, but you could try putting slf4j apis in your class path. (http://www.slf4j.org/download.html).

@see SOLR-2574 for a solution and sample working project. It's for Solr 3.2 but it works with Sorl 3.1 too.

In short, add a dependency on slf4j-nop.

   <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
      <version>1.6.1</version>
    </dependency>

A couple of months later, you may get the response.

Had the exact same issue and I was able to get over it by actually using absolute paths to the data import handler.

anchormath

#solr 3.5 : The classloader issue has been correctly identified above, but the solution didn't seem to work for me. I just put the dataimporthandler jars into the solr.war file and that worked, of course.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!