lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl (JIRA) <>
Subject [jira] [Commented] (SOLR-13180) ClassCastExceptions in o.a.s.s.facet.FacetModule for valid JSON inputs that are not objects
Date Thu, 31 Jan 2019 13:25:00 GMT


Jan Høydahl commented on SOLR-13180:

To reproduce:
bin/solr start -c
bin/solr create -c films
curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field": {"name":"name",
"type":"text_general", "multiValued":false, "stored":true}}' http://localhost:8983/solr/films/schema
bin/post -c films example/films/films.json
curl "http://localhost:8983/solr/films/select?json=0"
Attaching a patch that, when applied, instead returns:
    "msg":"Expected JSON Object in query parameter json, but got java.lang.Long",

> ClassCastExceptions in o.a.s.s.facet.FacetModule for valid JSON inputs that are not objects
> -------------------------------------------------------------------------------------------
>                 Key: SOLR-13180
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Facet Module
>    Affects Versions: 7.5, master (9.0)
>         Environment: Running on Unix, using a recent git checkout of master and the films
example database.
> h2. Steps to reproduce
>  * Build commit ea2c8ba of Solr as described in the section below.
>  * Build the films collection as described below.
>  * Start the server using the command “./bin/solr start -f -p 8983 -s /tmp/home”
>  * Request the URL above.
> h2. Compiling the server
> {{git clone []}}
> {{cd lucene-solr
> git checkout ea2c8ba
> ant compile
> cd solr
> ant server
> }}
> h2. Building the collection
> We followed Exercise 2 from the quick start tutorial ([]).
The attached file ( gives the contents of folder /tmp/home that you will obtain by
following the steps below.
> {{mkdir -p /tmp/home
> echo '<?xml version="1.0" encoding="UTF-8" ?><solr></solr>' > /tmp/home/solr.xml}}
> In one terminal start a Solr instance in foreground:
> {{./bin/solr start -f -p 8983 -s /tmp/home}}
> In another terminal, create a collection of movies, with no shards and no replication:
> {{bin/solr create -c films
> curl -X POST -H 'Content-type:application/json' --data-binary '\{"add-field": {"name":"name",
"type":"text_general", "multiValued":false, "stored":true}}' [http://localhost:8983/solr/films/schema]}}
> {{curl -X POST -H 'Content-type:application/json' --data-binary '\{"add-copy-field" :
{"source":"*","dest":"_text_"}}' [http://localhost:8983/solr/films/schema]}}
> {{./bin/post -c films example/films/films.json}}
>            Reporter: Johannes Kloos
>            Priority: Minor
>              Labels: diffblue, newdev
>         Attachments: SOLR-13180.patch,
> Requesting the following URL gives a 500 error due to a ClassCastException in o.a.s.s.f.FacetModule:
> The error response is caught by an uncaught ClassCastException, with the stacktrace shown
> java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map
> at
> at org.apache.solr.handler.component.SearchHandler.handleRequestBody(
> The cause of this bug is similar to #13178: line 78 in FacetModule reads
> {{jsonFacet = (Map<String, Object>) json.get("facet")}}
> and assumes that the JSON object contained in facet is a JSON object, while we only guarantee
that it is a JSON value.
> Line 92 semms to contain another situation like this, but I do not have a test case handy
for this specific case.
> This bug was found using [Diffblue Microservices Testing|].
Find more information on this [test campaign|].

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message