找不到Solr DataImportHandler [英] Solr DataImportHandler not found

查看:222
本文介绍了找不到Solr DataImportHandler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Tomcat 6.0.26的 Solr 3.3.0 。我能够成功安装Solr,我甚至能够使用http:/ localhost:8084 / solr / admin访问它的web界面。

I am using Solr 3.3.0 with Tomcat 6.0.26. I was able to successfully install Solr and i was even able to access its web interface using http:/localhost:8084/solr/admin.

现在我想使用它的我已经在我的solrconfig中添加了以下内容:

Now i want to use its dataimporthandler to index data from my database.I have added following to my solrconfig:

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

我也在同一个目录中创建了一个data-config.xml。

I have also created a data-config.xml in same directory.

我的solrconfig文件有dataimport的以下位置

My solrconfig file has following location for dataimport

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

并且我已经检查dataimporthandler.jar文件存在于dist文件夹中的以下路径C:\ web \solr\example\lib\apache-solr-3.3.0 \ dist

And i have checked that dataimporthandler.jar file exist in the dist folder at following path C:\web\solr\example\lib\apache-solr-3.3.0\dist

但是每当我键入http:/ localhost:8084 / solr / dataimport或http:/ localhost:8084 / solr / admin / dataimport它说资源不可用。我认为这是一些问题与Tomcat设置,所以我停止tomcat,并尝试从cmd使用java -jar start.jar启动Solr。我收到以下错误

But whenever I type http:/localhost:8084/solr/dataimport or http:/localhost:8084/solr/admin/dataimport it says resource unavailable. I thought it was dur to some problem with Tomcat setting so i stopped tomcat and tried to start Solr from cmd using java -jar start.jar. And i get the following error

HTTP ERROR 500
Problem accessing /solr/. Reason:
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: 

<abortOnConfigurationError>false</abortOnConfigurationError>

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:389)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:423)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:459)
at  
  org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:157)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:563)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:463)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:316)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:207)
at 
   org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:130)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:94)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at 
 org.mortbay.jetty.handler.ContextHandlerCollection.doStart
 (ContextHandlerCollection.java:156)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mortbay.start.Main.invokeMain(Main.java:194)
at org.mortbay.start.Main.start(Main.java:534)
at org.mortbay.start.Main.start(Main.java:441)
at org.mortbay.start.Main.main(Main.java:119)
  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:373)
... 34 more


推荐答案

我一直在使用solr 4.1和tomcat查看这个问题。我不能包括我需要的库与< lib dir =../../ dist /regex =solr-dataimporthandler - 。* \.jar/> - > ,我认为这是正确的,因为从我有solrconfig.xml的目录,它是两个目录,一个到dist。直到我暂时在直接路径(对我来说,/ opt / solr / dist),我意识到,问题是我从错误的目录开始。原来,我需要的是:

I've been looking at this problem for a bit on my own, using solr 4.1 and tomcat. I wasn't able to include the library I needed with <lib dir="../../dist/" regex="solr-dataimporthandler-.*\.jar" /> -->, which I figured had to be correct because from the directory that I had the solrconfig.xml in, it was two directories up and one down to dist. It wasn't until I temporarily subbed in the direct path (for me, /opt/solr/dist) that I realized that the problem was that I was starting from the wrong directory. It turns out that what I needed was:

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

因此,如果您在包含此文件时遇到问题,请检查您是否从目录包含您的conf目录,而不是conf目录本身。

So, if you're having trouble with including this, check that you're starting from the directory that contains your conf directory, and not the conf directory itself.

这篇关于找不到Solr DataImportHandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆