问题描述
我似乎遇到问题让solr运行,我按照这里的指南
一切顺利,但现在我试图从mysql导入数据。为此,我一直遵循本指南
。
< requestHandler name =/ dataimportclass = org.apache.solr.handler.dataimport.DataImportHandler>
< lst name =defaults>
< str name =config> data-config.xml< / str>
< / lst>
< / requestHandler>
这是我得到的错误。如果我删除这个,solr运行正常,但是我当然不能从mysql导入。
HTTP状态500 - {msg = SolrCore' collection1'由于init失败而不可用:
RequestHandler init失败,trace = org.apache.solr.common.SolrException:SolrCore
'collection1'由于init失败而不可用: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)
在
org.apache的org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)。 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)在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初始化失败在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另外
导致:org.apache.solr.common.SolrException:RequestHandler init失败在
org.apache .solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:168)at
org.apache.solr.core.SolrCore。< init>(SolrCore.java:758)... 13更多Caused by:
org.apache.solr.common.SolrException:在
加载类
时出错org.apache.solr.handler.dataimport.DataImportHandler'org.apache.solr.core.SolrResourceLoader.findClass
org.apache.solr.core.SolrCore.createInstance(SolrCore.java:SolrResourceLoader.java:464)at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:396) 518)at
org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:592)at
org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:154).. 。
14更多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 。java.lang.Class.forName0(Native
方法)中的.lang.ClassLoader.loadClass(ClassLoader.java:357)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,我不知道如果我做的正确..我想知道是否这可能是问题的一部分。
$ b $上面的教程
指示我们复制
example / solr /
至
/ home / solr
除此之外,solr提供的特定示例不包含必要的文件
1)在solr实例中创建一个'lib'文件夹(/ home / solr / lib)
2)从您下载solr的文件夹复制 / dist / solr-dataimporthandler-xxxjar
和
solr-dataimporthandler-extras-xxxjar
。
如果您还没有在此文件夹中有mysql-connector-java.jar,请将它们粘贴到您新创建的lib文件夹中。
3)重新启动服务器。
I seem to be having problems getting solr up and running, I followed the guide here
http://andres.jaimes.net/878/setup-lucene-solr-centos-tomcat/
All went well, but now I'm trying to import data from mysql. To do this I have been following this guide
http://www.wheelsandcogs.co.uk/2011/01/13/solr-tomcat-mysql-ubuntu/
The error comes when I add this to my solrconfig.xml
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
This is the error I get. If I remove this, solr runs fine but of course I cannot import from 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}
I am running Centos, hence using the first guide to get solr up and running. The 2nd guide is for Ubuntu, there is a step near the beginning about installing the JDBC, I am not sure if I did it right.. I'm wondering if this may be part of the problem.
It turns out I made a stupid mistake.
The tutorial above http://andres.jaimes.net/878/setup-lucene-solr-centos-tomcat/
Instructs us to copy
example/solr/
to
/home/solr
Except, this particular example provided by solr does not contain the necessary files to handle dataimports.
To fix this:
1) Create a 'lib' folder in your solr instance (/home/solr/lib)
2) From the folder where you downloaded solr to, copy /dist/solr-dataimporthandler-x.x.x.jar
and solr-dataimporthandler-extras-x.x.x.jar
. Paste both into your newly created lib folder.
Also ensure you have mysql-connector-java.jar in this folder if you haven't already.
3) Restart the server.
这篇关于Solr RequestHandler初始化失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!