一尘不染

Solr RequestHandler初始化失败

tomcat

我似乎在启动和运行Solr时遇到问题,我按照这里的指南进行操作

http://andres.jaimes.net/878/setup-lucene-solr-centos-
tomcat/

一切顺利,但是现在我正尝试从mysql导入数据。为此,我一直在遵循本指南

http://www.wheelsandcogs.co.uk/2011/01/13/solr-tomcat-mysql-
ubuntu/

当我将其添加到solrconfig.xml中时出现错误

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

这是我得到的错误。如果我删除它,solr运行正常,但是我当然不能从mysql导入。

HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure:
RequestHandler init failure,trace=org.apache.solr.common.SolrException: SolrCore 
'collection1' is not available due to init failure: RequestHandler init failure at 
org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1212) at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:248) at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav
a:235) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java
:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at 
java.lang.Thread.run(Thread.java:724) Caused by: org.apache.solr.common.SolrException: 
RequestHandler init failure at org.apache.solr.core.SolrCore.<init>(SolrCore.java:821) at 
org.apache.solr.core.SolrCore.<init>(SolrCore.java:618) at 
org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:949) at 
org.apache.solr.core.CoreContainer.create(CoreContainer.java:984) at 
org.apache.solr.core.CoreContainer$2.call(CoreContainer.java:597) at 
org.apache.solr.core.CoreContainer$2.call(CoreContainer.java:592) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at 
java.util.concurrent.FutureTask.run(FutureTask.java:166) at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at 
java.util.concurrent.FutureTask.run(FutureTask.java:166) at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ... 1 more 
Caused by: org.apache.solr.common.SolrException: RequestHandler init failure at 
org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:168) at 
org.apache.solr.core.SolrCore.<init>(SolrCore.java:758) ... 13 more Caused by: 
org.apache.solr.common.SolrException: Error loading class 
'org.apache.solr.handler.dataimport.DataImportHandler' at 
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:464) at 
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:396) at 
org.apache.solr.core.SolrCore.createInstance(SolrCore.java:518) at 
org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:592) at 
org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:154) ... 
14 more Caused by: java.lang.ClassNotFoundException: 
org.apache.solr.handler.dataimport.DataImportHandler at 
java.net.URLClassLoader$1.run(URLClassLoader.java:366) at 
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at 
java.security.AccessController.doPrivileged(Native Method) at 
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at 
java.lang.ClassLoader.loadClass(ClassLoader.java:424) at 
java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789) at 
java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native 
Method) at java.lang.Class.forName(Class.java:270) at 
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:448) ... 18 more 
,code=500}

我正在运行Centos,因此使用第一个指南来启动和运行solr。第二个指南是针对Ubuntu的,在安装JDBC的开始附近还有一步,我不确定我是否做对了。。我想知道这是否可能是问题的一部分。


阅读 443

收藏
2020-06-16

共1个答案

一尘不染

原来我犯了一个愚蠢的错误。

上面的教程http://andres.jaimes.net/878/setup-lucene-solr-centos-
tomcat/

指示我们复制

example/solr/

/home/solr

除此之外,solr提供的此特定示例不包含处理数据导入所需的文件。

要解决此问题:

1)在您的Solr实例(/ home / solr / lib)中创建一个’lib’文件夹

2)从下载solr的文件夹中,复制/dist/solr-dataimporthandler-x.x.x.jarsolr- dataimporthandler-extras-x.x.x.jar。将两者都粘贴到新创建的lib文件夹中。

如果还没有的话,还要确保在该文件夹中有mysql-connector-java.jar。

3)重新启动服务器。

2020-06-16