You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jason Rutherglen <ja...@gmail.com> on 2010/06/01 22:20:20 UTC
Inserting shards in overridden SearchComponent prepare method yields
null pointer
The insert shards code is as follows:
ModifiableSolrParams modParams = new ModifiableSolrParams(params);
modParams.set("shards", shards);
rb.req.setParams(modParams);
Where shards is a valid single shard pseudo URL.
Stacktrace:
HTTP Status 500 - null java.lang.NullPointerException at
org.apache.solr.handler.component.QueryComponent.createRetrieveDocs(QueryComponent.java:497)
at org.apache.solr.handler.component.QueryComponent.distributedProcess(QueryComponent.java:298)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:234)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:342)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:245)
at
Re: Inserting shards in overridden SearchComponent prepare method
yields null pointer
Posted by Chris Hostetter <ho...@fucit.org>.
Wild shot in the dark: if the list of shards is changed between prepare
method and hte process method of the QueryComponent that could tickle some
code path that was never expected, and maybe trigger an NPE (ie: looking
up some IDs in a map keyed off of shard and now the shard is something
that never had a value put in that map) ... so it really dpeends where
your component is registered in the component list.
like i said: wild shot i nthe dark. you ahven't posted a lot of details
(for instance: i assume that stack trace is coming from the shard, not the
collator -- but again that's just a guess)
: Date: Tue, 1 Jun 2010 13:20:20 -0700
: From: Jason Rutherglen <ja...@gmail.com>
: Reply-To: solr-user@lucene.apache.org
: To: solr-user@lucene.apache.org
: Subject: Inserting shards in overridden SearchComponent prepare method yields
: null pointer
:
: The insert shards code is as follows:
:
: ModifiableSolrParams modParams = new ModifiableSolrParams(params);
: modParams.set("shards", shards);
: rb.req.setParams(modParams);
:
: Where shards is a valid single shard pseudo URL.
:
: Stacktrace:
:
: HTTP Status 500 - null java.lang.NullPointerException at
: org.apache.solr.handler.component.QueryComponent.createRetrieveDocs(QueryComponent.java:497)
: at org.apache.solr.handler.component.QueryComponent.distributedProcess(QueryComponent.java:298)
: at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:234)
: at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
: at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at
: org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:342)
: at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:245)
: at
:
-Hoss