You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "tom liu (JIRA)" <ji...@apache.org> on 2010/10/09 12:01:42 UTC
[jira] Created: (SOLR-2147) NPE throws in ShardDoc's
ShardFieldSortedHitQueue when Distributed Searching
NPE throws in ShardDoc's ShardFieldSortedHitQueue when Distributed Searching
----------------------------------------------------------------------------
Key: SOLR-2147
URL: https://issues.apache.org/jira/browse/SOLR-2147
Project: Solr
Issue Type: Bug
Affects Versions: 4.0
Environment: JDK1.6/Tomcat6
Reporter: tom liu
when distributed searching use katta components(solr-1395), throws NPE:
Oct 9, 2010 5:43:59 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.NullPointerException
at org.apache.solr.handler.component.ShardFieldSortedHitQueue$1.compare(ShardDoc.java:210)
at org.apache.solr.handler.component.ShardFieldSortedHitQueue.lessThan(ShardDoc.java:134)
at org.apache.lucene.util.PriorityQueue.upHeap(PriorityQueue.java:221)
at org.apache.lucene.util.PriorityQueue.add(PriorityQueue.java:130)
at org.apache.lucene.util.PriorityQueue.insertWithOverflow(PriorityQueue.java:146)
at org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:555)
at org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:408)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:304)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.katta.SolrKattaServer.request(SolrKattaServer.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:508)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:959)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:953)
i found that sharddoc.java 210 was :
final float f1 = e1.score;
final float f2 = e2.score;
score field is Float type, it may be null. so should be changed as:
final float f1 = e1.score==null?0.00f:e1.score;
final float f2 = e2.score==null?0.00f:e2.score;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] Commented: (SOLR-2147) NPE throws in ShardDoc's
ShardFieldSortedHitQueue when Distributed Searching
Posted by "tom liu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12919558#action_12919558 ]
tom liu commented on SOLR-2147:
-------------------------------
i found that in solr, only QueryComponent's mergeIds method, would construct ShardDoc, as:
ShardDoc shardDoc = new ShardDoc();
shardDoc.id = id;
shardDoc.shard = srsp.getShard();
shardDoc.orderInShard = i;
Object scoreObj = doc.getFieldValue("score");
if (scoreObj != null) {
if (scoreObj instanceof String) {
shardDoc.score = Float.parseFloat((String)scoreObj);
} else {
shardDoc.score = (Float)scoreObj;
}
}
But, if scoreObj is null, shardDoc.score must be null.
So, what about if this is happen?
> NPE throws in ShardDoc's ShardFieldSortedHitQueue when Distributed Searching
> ----------------------------------------------------------------------------
>
> Key: SOLR-2147
> URL: https://issues.apache.org/jira/browse/SOLR-2147
> Project: Solr
> Issue Type: Bug
> Affects Versions: 4.0
> Environment: JDK1.6/Tomcat6
> Reporter: tom liu
>
> when distributed searching use katta components(solr-1395), throws NPE:
> Oct 9, 2010 5:43:59 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.NullPointerException
> at org.apache.solr.handler.component.ShardFieldSortedHitQueue$1.compare(ShardDoc.java:210)
> at org.apache.solr.handler.component.ShardFieldSortedHitQueue.lessThan(ShardDoc.java:134)
> at org.apache.lucene.util.PriorityQueue.upHeap(PriorityQueue.java:221)
> at org.apache.lucene.util.PriorityQueue.add(PriorityQueue.java:130)
> at org.apache.lucene.util.PriorityQueue.insertWithOverflow(PriorityQueue.java:146)
> at org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:555)
> at org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:408)
> at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:304)
> at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> at org.apache.solr.katta.SolrKattaServer.request(SolrKattaServer.java:97)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:508)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:959)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:955)
> at java.security.AccessController.doPrivileged(Native Method)
> at javax.security.auth.Subject.doAs(Subject.java:396)
> at org.apache.hadoop.ipc.Server$Handler.run(Server.java:953)
> i found that sharddoc.java 210 was :
> final float f1 = e1.score;
> final float f2 = e2.score;
> score field is Float type, it may be null. so should be changed as:
> final float f1 = e1.score==null?0.00f:e1.score;
> final float f2 = e2.score==null?0.00f:e2.score;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org