You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Marius Grama (JIRA)" <ji...@apache.org> on 2016/03/24 09:15:25 UTC

[jira] [Commented] (SOLR-8851) ClassCastException in SearchHandler

    [ https://issues.apache.org/jira/browse/SOLR-8851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15209950#comment-15209950 ] 

Marius Grama commented on SOLR-8851:
------------------------------------

The only place I see that ExitingReaderException is being thrown is in the {{ExitableDirectoryReader.ExitableTermsEnum}} class.

I could reproduce the {{ExitableDirectoryReader.ExitingReaderException}} in the class {{SearchHandler}} by using the following query :

http://localhost:8983/solr/techproducts/terms?terms.fl=name&timeAllowed=1

In this case, the call {{rb.rsp.getValues().get("response")}} returns {{null}} reason why the variable {{r}} of type {{SolrDocumentList}} will be explicitly instantiated and the issue reported by you doesn't occur.

On the other hand, I see in the {{QueryComponent}} class that an object instance of type {{ResultContext}} is used  for "response"

{code}
    ResultContext ctx = new ResultContext();
    ctx.docs = rb.getResults().docList;
    ctx.query = rb.getQuery();
    rsp.add("response", ctx);
{code}

, so the code line SearchHandler.java 293 is not quite correct : 

{code}
SolrDocumentList r = (SolrDocumentList) rb.rsp.getValues().get("response");
{code}

Could you give me a concrete solr query for reproducing the issue?

> ClassCastException in SearchHandler
> -----------------------------------
>
>                 Key: SOLR-8851
>                 URL: https://issues.apache.org/jira/browse/SOLR-8851
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 5.4.1
>            Reporter: Pascal Chollet
>
> When there is a query timeout in non-distrub mode, {{SearchHandler}} is throwing a {{ClassCastException}}:
> {code}java.lang.ClassCastException: org.apache.solr.response.ResultContext cannot be cast to org.apache.solr.common.SolrDocumentList
> 	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:293)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:156)
> 	...{code}
> The problem can be reproduced if any component running after {{QueryComponent}} times out - in our case it is {{FacetComponent}} which throws a {{ExitingReaderException}}.
> {{SearchHandler:293}} expects a {{SolrDocumentList}} in {{rsp.response}}, but {{QueryComponent}} did add a {{ResultContext}} instead.
> It looks like this is not a problem, if the {{QueryComponent}} itself is timing out, as rsp.response is null in that case. It's only a problem if a component after {{QueryComponent}} is timing out.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org