You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Richard Walker (JIRA)" <ji...@apache.org> on 2019/07/24 00:31:00 UTC

[jira] [Commented] (SOLR-12858) EmbeddedSolrServer POST method has contentType issue

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

Richard Walker commented on SOLR-12858:
---------------------------------------

Just ran into this on 8.1.1.

I use an HttpSolrClient with a standalone Solr for production use, but an EmbeddedSolrServer for my test suite.

I just switched from GET to POST precisely to cope with large query strings, and now my test suite fails. Workaround for now in this case is to change my search method to do an instanceof test on the client before running the query, which (of course) is  the sort of thing I want to avoid.

 

> EmbeddedSolrServer POST method has contentType issue
> ----------------------------------------------------
>
>                 Key: SOLR-12858
>                 URL: https://issues.apache.org/jira/browse/SOLR-12858
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 7.4, 7.5
>            Reporter: Phillip Klinefelter
>            Priority: Major
>
> EmbeddedSolrServer will fail with the following exception when using a POST method.
> {{org.apache.solr.common.SolrException: Bad contentType for search handler :application/javabin request=\{q=*:*}}}{{    at org.apache.solr.request.json.RequestUtil.processParams(RequestUtil.java:73)}}
> {{     at org.apache.solr.util.SolrPluginUtils.setDefaults(SolrPluginUtils.java:167)}}
> {{     at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:196)}}
> {{     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2539)}}
> {{     at org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:191)}}
> {{     at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:194)}}
> {{     at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:974)}}
> {{     at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:990)}}
> A POST method can be added to TestEmbeddedSolrServerConstructors to reproduce or do the following.
> {{embeddedSolrServer.query(new SolrQuery("*:*"), SolrRequest.METHOD.POST);}}
> This worked before Solr 7.4.  The issue appears to have been caused by changes made in SOLR-12142 based on debugging and a discussion I had with [~dsmiley].
> CC [~noble.paul]
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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