Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-6167

SolrDocumentList cannot be cast to ResultContext on Solr 4.8.0

    XMLWordPrintableJSON

    Details

      Description

      Hello,

      I have a running instance of Solr 4.2.1 (I will refer to it as 'instance A') and I am trying to pass to Solr 4.8.0. For this purpose, I created a copy of the machine which hosts 'instance A' (I will refer to the copy as 'instance B') and, on this new machine, I have installed Solr 4.8.0 and I have created a collection with 4 shards. Then, on the new machine, I have iterated over a copy of the index built on instance A and I have re-indexed all the documents and inserted them inside the new collection of Solr 4.8.0. I have completed this process, the two index seem to contain the same documents and I am successfully able to query properly both the indexes.

      When I try to run the following query on 'instance A':

      http://instance_A_ip:23332/solr/myindex/query?q=id%3Amyid&fl=html&wt=html

      I get a well formatted html response. Unfortunately, when I try the same query on the 'instance B'

      http://instance_B_ip:23332/solr/mycollection/query?q=id%3Amyid&fl=html&wt=html

      I receive the following error code:

      HTTP Status 500 -

      {msg=org.apache.solr.common.SolrDocumentList cannot be cast to org.apache.solr.response.ResultContext,trace=java.lang.ClassCastException: org.apache.solr.common.SolrDocumentList cannot be cast to org.apache.solr.response.ResultContext at my.library.solr.HtmlResponseWriter.write(HtmlResponseWriter.java:33) at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:762) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:431) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:744) ,code=500}

      This is the error that I grep from the solr log file:

      org.apache.solr.common.SolrException; null:java.lang.ClassCastException: org.apache.solr.common.SolrDocumentList cannot be cast to org.apache.solr.response.ResultContext
      at my.library.solr.HtmlResponseWriter.write(HtmlResponseWriter.java:33)
      at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:762)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:431)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:744)

      This is the error that I grep from the tomcat log file:

      org.apache.solr.servlet.SolrDispatchFilter – null:java.lang.ClassCastException: org.apache.solr.common.SolrDocumentList cannot be cast to org.apache.solr.response.ResultContext
      at my.library.solr.HtmlResponseWriter.write(HtmlResponseWriter.java:33)
      at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:762)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:431)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:744)

      The differences between instance A and instance B are:

      • the Solr versions
      • on instance A, I am using a single Solr instance (without Solr Cloud)
      • on instance B, I am using Solr Cloud and I created a collection with 4 shards
      • I removed a couple of not necessary fields inside the schema of the instance B when I created the collection (before to load documents) and I loaded documents according to the new schema (I have not loaded the removed fields)

      The instance B is installed on a clone of the machine on which instance A is running, so the software stack as well as the hardware are the same. On both the machines I have installed Apache Tomcat 6.0.37.

      If I try to run the same query on instance B by specifying wt=csv I obtain the right field value, but unfortunately it's not a well formatted html reply.

      Inside the schema on instance A, these are the information related to the html field:

      Field: html
      Flags: Stored
      Properties yes
      Schema yes
      Field-Type: org.apache.solr.schema.StrField
      Index Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
      Query Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer

      Inside the schema on instance B, these are the information related to the html field:

      Field: html
      Flags: Stored Sort Missing Last
      Properties yes yes
      Schema yes yes
      Field-Type: org.apache.solr.schema.StrField
      Index Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
      Query Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer

      Do you know if there is a way to execute on a Solr cloud collection with Solr 4.8.0 this same query that I am successfully able to execute on my single instance of Solr 4.2.1?

      I would really appreciate every suggestion about it. Please, let me know if you need any further information.

      Thank you.

      Best Regards,

      Guido

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gharm Guido
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: