Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NullPointerException in solr multicore

I'm configuring my solr for two cores and have got most of it working, but I'm getting this cryptic error.

First off, here's my 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>

All of this seems fine. I believe I've set the proper permissions for all the locations, but still I get this error in 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)

Some [info] logs and then this one:

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)

I'm not a top cat in solr, java or tomcat (or much else for that matter, hehe). Any help is will be greatly appreciated!

like image 936
Jorn Avatar asked Aug 08 '10 14:08

Jorn


2 Answers

It seems like this happens because QueryElevationComponent's config doesn't exist. Try this:

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

like image 198
Aillyn Avatar answered Oct 19 '22 13:10

Aillyn


It happened to me that I copied the previous solrconfig.xml, so the elevator.xml path reference was wrong.

If you started from the template search for:

<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>

And change it to:

<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>

Assuming you're using all the default directories.

like image 31
Guillermo Winkler Avatar answered Oct 19 '22 13:10

Guillermo Winkler