2010-08-08 61 views
6

我正在爲兩個內核配置我的solr,並且已經完成了大部分工作,但是我收到了這個神祕的錯誤。Solr多核中的NullPointerException

首先,這裏是我的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) 

一些[信息]日誌,那麼這一個:

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中的頂級貓(或者其他許多方面,嘿嘿)。任何幫助將不勝感激!

回答

4

它發生在我身上,我複製先前的solrconfig.xml中,所以elevator.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> 

假設你正在使用的所有默認目錄。

+0

謝謝 - 我剛碰到同樣的問題,並修復它:) – vitch 2011-12-13 18:21:02