[ 
https://issues.apache.org/jira/browse/SOLR-2408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-2408:
---------------------------

    Description: 
JSONWriter will produce an NullPointerException if an int field stored, and 
then the schema.xml is updated to change the type.  

In general, Solr should try to generate better error messages in situations 
like this.


  was:
SEVERE: java.lang.NullPointerException
        at 
org.apache.solr.request.JSONWriter.writeStr(JSONResponseWriter.java:613)
        at org.apache.solr.schema.TextField.write(TextField.java:49)
        at org.apache.solr.schema.SchemaField.write(SchemaField.java:113)
        at 
org.apache.solr.request.JSONWriter.writeDoc(JSONResponseWriter.java:383)
        at 
org.apache.solr.request.JSONWriter.writeDoc(JSONResponseWriter.java:449)
        at 
org.apache.solr.request.JSONWriter.writeDocList(JSONResponseWriter.java:496)
        at 
org.apache.solr.request.TextResponseWriter.writeVal(TextResponseWriter.java:141)
        at 
org.apache.solr.request.JSONWriter.writeNamedListAsMapWithDups(JSONResponseWriter.java:179)
        at 
org.apache.solr.request.JSONWriter.writeNamedList(JSONResponseWriter.java:294)
        at 
org.apache.solr.request.JSONWriter.writeResponse(JSONResponseWriter.java:92)
        at 
org.apache.solr.request.JSONResponseWriter.write(JSONResponseWriter.java:51)
        at 
org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:325)
        at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:254)
        at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
        at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
        at 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:285)
        at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
        at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
        at 
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
        at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)


To reproduce the exception, the following ingredients are required:
- A query that is sorted by a date field in DESC order, ASC will not crash
- A multivalued field like so <field name="deleted_in" type="text" 
indexed="true" stored="true" multiValued="true" />
- Exclude the multivalued field from either the query (AND NOT deleted_in:XXX) 
or with a filter query (-deleted_in:XXX)
- The value XXX of deleted_in MUST MATCH at least one value, if not, the crash 
will not occur.


        Summary: JSONWriter NPE if data in stored Document does not match field 
type info in schema  (was: Solr 1.4.1 javaNullPointerException)

clarifying summary and description, original description was...

{quote}
SEVERE: java.lang.NullPointerException
        at 
org.apache.solr.request.JSONWriter.writeStr(JSONResponseWriter.java:613)
        at org.apache.solr.schema.TextField.write(TextField.java:49)
        at org.apache.solr.schema.SchemaField.write(SchemaField.java:113)
        at 
org.apache.solr.request.JSONWriter.writeDoc(JSONResponseWriter.java:383)
        at 
org.apache.solr.request.JSONWriter.writeDoc(JSONResponseWriter.java:449)
        at 
org.apache.solr.request.JSONWriter.writeDocList(JSONResponseWriter.java:496)
        at 
org.apache.solr.request.TextResponseWriter.writeVal(TextResponseWriter.java:141)
        at 
org.apache.solr.request.JSONWriter.writeNamedListAsMapWithDups(JSONResponseWriter.java:179)
        at 
org.apache.solr.request.JSONWriter.writeNamedList(JSONResponseWriter.java:294)
        at 
org.apache.solr.request.JSONWriter.writeResponse(JSONResponseWriter.java:92)
        at 
org.apache.solr.request.JSONResponseWriter.write(JSONResponseWriter.java:51)
        at 
org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:325)
        at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:254)
        at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
        at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
        at 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:285)
        at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
        at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
        at 
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
        at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)


To reproduce the exception, the following ingredients are required:
- A query that is sorted by a date field in DESC order, ASC will not crash
- A multivalued field like so <field name="deleted_in" type="text" 
indexed="true" stored="true" multiValued="true" />
- Exclude the multivalued field from either the query (AND NOT deleted_in:XXX) 
or with a filter query (-deleted_in:XXX)
- The value XXX of deleted_in MUST MATCH at least one value, if not, the crash 
will not occur.

{quote}

> JSONWriter NPE if data in stored Document does not match field type info in 
> schema
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-2408
>                 URL: https://issues.apache.org/jira/browse/SOLR-2408
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.4.1
>         Environment: OS X, possibly other *ix as well
>            Reporter: Christos Constantinou
>            Priority: Minor
>
> JSONWriter will produce an NullPointerException if an int field stored, and 
> then the schema.xml is updated to change the type.  
> In general, Solr should try to generate better error messages in situations 
> like this.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to