solr multicore中的NullPointerException

时间:2010-08-08 14:20:43

标签: tomcat lucene solr multicore

我正在为两个内核配置我的solr并且已经完成了大部分工作,但我收到了这个神秘的错误。

首先,这是我的solr.xml:

<?xml version='1.0' encoding='UTF-8'?>
<solr persistent="true">
 <cores adminPath="/admin/cores">
  <core name="cars" dataDir="/var/lib/solr/data/cars" config="/etc/solr/home_cars/conf/solrconfig.xml" schema="/etc/solr/home_cars/conf/schema.xml" instanceDir="home_cars" />
  <core name="industrial" dataDir="/var/lib/solr/data/industrial" config="/etc/solr/home_industrial/conf/solrconfig.xml" schema="/etc/solr/home_industrial/conf/schema.xml" instanceDir="home_industrial" />
 </cores>
</solr>

所有这一切似乎都很好。我相信我已经为所有位置设置了适当的权限,但我仍然在catalina.out中收到此错误:

INFO: user.dir=/var/lib/tomcat6
Aug 8, 2010 2:03:27 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.NullPointerException
        at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1317)
        at org.apache.solr.core.QuerySenderListener.newSearcher(QuerySenderListener.java:52)
        at org.apache.solr.core.SolrCore$3.call(SolrCore.java:1147)
        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:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)

一些[info]记录然后这个:

SEVERE: java.lang.NullPointerException
        at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1317)
        at org.apache.solr.core.QuerySenderListener.newSearcher(QuerySenderListener.java:52)
        at org.apache.solr.core.SolrCore$3.call(SolrCore.java:1147)
        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:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)

我不是solr,java或tomcat的顶级猫(或其他很多东西,呵呵)。任何帮助将不胜感激!

2 个答案:

答案 0 :(得分:5)

似乎发生这种情况是因为QueryElevationComponent的配置不存在。试试这个:

http://wiki.apache.org/solr/QueryElevationComponent

答案 1 :(得分:4)

我碰巧复制了之前的solrconfig.xml,因此elev.xml路径引用错误。

如果您从模板搜索开始:

<searchComponent name="elevator" class="solr.QueryElevationComponent" >
 <!-- pick a fieldType to analyze queries -->
 <str name="queryFieldType">string</str>
 <str name="config-file">elevate.xml</str>
</searchComponent>

并将其更改为:

<searchComponent name="elevator" class="solr.QueryElevationComponent" >
 <!-- pick a fieldType to analyze queries -->
 <str name="queryFieldType">string</str>
 <str name="config-file">../../conf/elevate.xml</str>
</searchComponent>

假设您正在使用所有默认目录。