为什么我不能在JBoss上的Solr中实例化DataImportHandler? [英] Why can't I instantiate DataImportHandler in Solr on JBoss?

查看:118
本文介绍了为什么我不能在JBoss上的Solr中实例化DataImportHandler?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在JBoss 5.1上设置Solr 3.5.0。一切都很好。我将war复制到deploy dir,将dist和contrib目录中的所有依赖项复制到lib(或早期部署)目录中。

I'm trying to set up Solr 3.5.0 on JBoss 5.1. Everything works quite fine. I copied war into deploy dir, all the dependencies from dist and contrib directories into the lib (or earlier deploy) directory.

我可以启动服务器,一切正常,但每当我想激活DataImportHandler来索引我的数据库中的数据时,我都会收到错误。

I can start a server, everything works fine, but whenever I want to activate the DataImportHandler to index data in my DB, I get an error.

基本上我所做的就是我复制的是我从example / example-DIH / solr / db复制一个核心(或整个例子,这没关系),我在solr.xml中注册核心,在启动时我收到一个错误:

Basically what I do is I copy is I copy a core from example/example-DIH/solr/db (Or whole example, that doesn't matter), I register the core in solr.xml and at startup I get an error:

15:17:10,707 SEVERE [RequestHandlers] org.apache.solr.common.SolrException: Error Instantiating Request Handler, org.apache.solr.handler.dataimport.DataImportHandler is not a org.apache.solr.request.SolrRequestHandler
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:427)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:461)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:157)

我很确定我的请求处理程序定义是正确的,但只是为了确定:

I'm pretty sure my request handler definition is correct, but just to be sure:

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

据我所知,这个错误可能是由DataImportHandler和SolrRequestHandler引起的,据说是持有不同的类加载器。

As far as I can find, this error may be caused by DataImportHandler and SolrRequestHandler supposedly being hold different class loaders.

每当我从示例中的start.jar应用程序启动Solr时(我认为它启动了一个Jetty服务器)它运行正常。

Whenever I start a Solr from the start.jar app in example (I think it starts a Jetty server) it works fine.

我的问题是:这真的是因为类加载器问题还是其他一些问题?而且,更重要的是:我该如何修复它?

My question is: is this really because of the class loader issue, or some other thing? And, more importantly: how do I fix it?

推荐答案

这是一个类加载器问题,根据这个帖子您需要执行以下操作:

This is a class loader issue and according to this post on the Lucene Developer Mailing List you need to do the following:


确保dataimport jar不在类路径中而不被其他类加载器加载但是从solrconfig.xml中指定的路径。这将确保dataimport类由同一个类加载器加载。

make sure that the dataimport jars are NOT in the classpath and not loaded by other classloaders but from the path specified in solrconfig.xml. This will ensure that the dataimport classes are loaded by the same classloader.

请参阅主题以获取更多详细信息。

Please see the thread for more details.

这篇关于为什么我不能在JBoss上的Solr中实例化DataImportHandler?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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