A quick work-around is, I think, to tell Solr to use the non-binary response, e.g. &wt=xml (I think that's the "syntax").
Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch ----- Original Message ---- > From: syoung <[EMAIL PROTECTED]> > To: solr-user@lucene.apache.org > Sent: Wednesday, September 17, 2008 7:27:30 PM > Subject: Setting request method to post on SolrQuery causes ClassCastException > > > Hi, > > I need to have queries over a certain length done as a post instead of a > get. However, when I set the method to post, I get a ClassCastException. > Here is the code: > > public QueryResponse query(SolrQuery solrQuery) { > QueryResponse response = null; > try { > if (solrQuery.toString().length() > MAX_URL_LENGTH) > response = server.query(solrQuery, SolrRequest.METHOD.POST); > else > response = server.query(solrQuery, SolrRequest.METHOD.GET); > } catch (SolrServerException e) { > throw new DataAccessResourceFailureException(e.getMessage(), e); > } > return response; > } > > And the stack trace: > > java.lang.ClassCastException: java.lang.String > org.apache.solr.common.util.NamedListCodec.unmarshal(NamedListCodec.java:89) > org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:39) > org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:385) > org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:183) > org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90) > org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:113) > com.localmatters.guidespot.util.SolrTemplate.query(SolrTemplate.java:33) > > Thanks, > > Susan > > > -- > View this message in context: > http://www.nabble.com/Setting-request-method-to-post-on-SolrQuery-causes-ClassCastException-tp19543232p19543232.html > Sent from the Solr - User mailing list archive at Nabble.com.