You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Markus Jelsma <ma...@openindex.io> on 2010/12/08 14:38:59 UTC

Map size must not be negative with spatial results + php serialized

Hi,

Got another issue here. This time it's the PHP serialized response writer 
throwing the following exception only when spatial parameters are set using 
LocalParams in Solr 1.4.1 using JTeam's plugin:

Map size must not be negative

java.lang.IllegalArgumentException: Map size must not be negative
	at 
org.apache.solr.request.PHPSerializedWriter.writeMapOpener(PHPSerializedResponseWriter.java:224)
	at 
org.apache.solr.request.JSONWriter.writeSolrDocument(JSONResponseWriter.java:398)
	at 
org.apache.solr.request.JSONWriter.writeSolrDocumentList(JSONResponseWriter.java:553)
	at 
org.apache.solr.request.TextResponseWriter.writeVal(TextResponseWriter.java:148)
	at 
org.apache.solr.request.JSONWriter.writeNamedListAsMapMangled(JSONResponseWriter.java:154)
	at 
org.apache.solr.request.PHPSerializedWriter.writeNamedList(PHPSerializedResponseWriter.java:100)
	at 
org.apache.solr.request.PHPSerializedWriter.writeResponse(PHPSerializedResponseWriter.java:95)
	at 
org.apache.solr.request.PHPSerializedResponseWriter.write(PHPSerializedResponseWriter.java:69)
	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)

This is only triggered when the searchComponent is added to the request 
handler.

Cheers,

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Re: Map size must not be negative with spatial results + php serialized

Posted by Markus Jelsma <ma...@openindex.io>.
Well, in that case i'd open a ticket for this one. The problem is, for now, 
that i can only replicate the behaviour using the spatial plugin. 

On Wednesday 08 December 2010 21:58:06 Chris Hostetter wrote:
> : That's fine - it could be a Solr bug too.
> 
> it definitely looks like a generic solr bug.
> 
> JSONResponseWriter.java:398
> (in the writeSolrDocument method that supports psuedo-fields)
> 
>     writeMapOpener(-1); // no trivial way to determine map size
> 
> PHPSerializedResponseWriter.java:221
> (in which PHPSerializedWriter extends JSONWriter)...
> 
>   public void writeMapOpener(int size) throws IOException,
> IllegalArgumentException { // negative size value indicates that something
> has gone wrong
>   	if (size < 0) {
>   		throw new IllegalArgumentException("Map size must not be negative");
>   	}
> 
> 
> ...it looks like PHPSerializedResponseWriter is fundementally broken.
> 
> I suspect the origin of hte problem is that PHPSerializedWriter overrides
> "writeDoc" and that prevented the writeMapOpener(-1) from ever happening,
> but then "writeSolrDocument" was added which PHPSerializedWriter doesn't
> override that.
> 
> 
> 
> -Hoss

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Re: Map size must not be negative with spatial results + php serialized

Posted by Chris Hostetter <ho...@fucit.org>.
: That's fine - it could be a Solr bug too.

it definitely looks like a generic solr bug.

JSONResponseWriter.java:398
(in the writeSolrDocument method that supports psuedo-fields)

    writeMapOpener(-1); // no trivial way to determine map size

PHPSerializedResponseWriter.java:221 
(in which PHPSerializedWriter extends JSONWriter)...

  public void writeMapOpener(int size) throws IOException, IllegalArgumentException {
  	// negative size value indicates that something has gone wrong
  	if (size < 0) {
  		throw new IllegalArgumentException("Map size must not be negative");
  	}


...it looks like PHPSerializedResponseWriter is fundementally broken.

I suspect the origin of hte problem is that PHPSerializedWriter overrides 
"writeDoc" and that prevented the writeMapOpener(-1) from ever happening, 
but then "writeSolrDocument" was added which PHPSerializedWriter doesn't 
override that.



-Hoss

Re: Map size must not be negative with spatial results + php serialized

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Wed, Dec 8, 2010 at 9:45 AM, Markus Jelsma
<ma...@openindex.io> wrote:
> I know, but since it's an Apache component throwing the exception, i'd figure
> someone just might know more about this.

That's fine - it could be a Solr bug too.
IMO, solr-user traffic just needs to be solr related and hopefully
useful to other uses.

-Yonik
http://www.lucidimagination.com

Re: Map size must not be negative with spatial results + php serialized

Posted by Markus Jelsma <ma...@openindex.io>.
I know, but since it's an Apache component throwing the exception, i'd figure 
someone just might know more about this. An, the guys do visit the list afaik.

Anyway, i'd ask there too. Thanks 

On Wednesday 08 December 2010 15:41:21 Grant Ingersoll wrote:
> That sounds like a JTeam plugin problem, which is not supported here.
> 
> On Dec 8, 2010, at 5:38 AM, Markus Jelsma wrote:
> > Hi,
> > 
> > Got another issue here. This time it's the PHP serialized response writer
> > throwing the following exception only when spatial parameters are set
> > using LocalParams in Solr 1.4.1 using JTeam's plugin:
> > 
> > Map size must not be negative
> > 
> > java.lang.IllegalArgumentException: Map size must not be negative
> > 
> > 	at
> > 
> > org.apache.solr.request.PHPSerializedWriter.writeMapOpener(PHPSerializedR
> > esponseWriter.java:224)
> > 
> > 	at
> > 
> > org.apache.solr.request.JSONWriter.writeSolrDocument(JSONResponseWriter.j
> > ava:398)
> > 
> > 	at
> > 
> > org.apache.solr.request.JSONWriter.writeSolrDocumentList(JSONResponseWrit
> > er.java:553)
> > 
> > 	at
> > 
> > org.apache.solr.request.TextResponseWriter.writeVal(TextResponseWriter.ja
> > va:148)
> > 
> > 	at
> > 
> > org.apache.solr.request.JSONWriter.writeNamedListAsMapMangled(JSONRespons
> > eWriter.java:154)
> > 
> > 	at
> > 
> > org.apache.solr.request.PHPSerializedWriter.writeNamedList(PHPSerializedR
> > esponseWriter.java:100)
> > 
> > 	at
> > 
> > org.apache.solr.request.PHPSerializedWriter.writeResponse(PHPSerializedRe
> > sponseWriter.java:95)
> > 
> > 	at
> > 
> > org.apache.solr.request.PHPSerializedResponseWriter.write(PHPSerializedRe
> > sponseWriter.java:69)
> > 
> > 	at
> > 
> > org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilt
> > er.java:325)
> > 
> > 	at
> > 
> > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.ja
> > va:254)
> > 
> > 	at
> > 
> > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHand
> > ler.java:1089)
> > 
> > 	at
> > 
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
> > 
> > 	at
> > 
> > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:21
> > 6)
> > 
> > 	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(ContextHandlerC
> > ollection.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(HttpConnec
> > tion.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.jav
> > a:442)
> > 
> > This is only triggered when the searchComponent is added to the request
> > handler.
> > 
> > Cheers,
> 
> --------------------------
> Grant Ingersoll
> http://www.lucidimagination.com/
> 
> Search the Lucene ecosystem docs using Solr/Lucene:
> http://www.lucidimagination.com/search

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Re: Map size must not be negative with spatial results + php serialized

Posted by Grant Ingersoll <gs...@apache.org>.
That sounds like a JTeam plugin problem, which is not supported here.


On Dec 8, 2010, at 5:38 AM, Markus Jelsma wrote:

> Hi,
> 
> Got another issue here. This time it's the PHP serialized response writer 
> throwing the following exception only when spatial parameters are set using 
> LocalParams in Solr 1.4.1 using JTeam's plugin:
> 
> Map size must not be negative
> 
> java.lang.IllegalArgumentException: Map size must not be negative
> 	at 
> org.apache.solr.request.PHPSerializedWriter.writeMapOpener(PHPSerializedResponseWriter.java:224)
> 	at 
> org.apache.solr.request.JSONWriter.writeSolrDocument(JSONResponseWriter.java:398)
> 	at 
> org.apache.solr.request.JSONWriter.writeSolrDocumentList(JSONResponseWriter.java:553)
> 	at 
> org.apache.solr.request.TextResponseWriter.writeVal(TextResponseWriter.java:148)
> 	at 
> org.apache.solr.request.JSONWriter.writeNamedListAsMapMangled(JSONResponseWriter.java:154)
> 	at 
> org.apache.solr.request.PHPSerializedWriter.writeNamedList(PHPSerializedResponseWriter.java:100)
> 	at 
> org.apache.solr.request.PHPSerializedWriter.writeResponse(PHPSerializedResponseWriter.java:95)
> 	at 
> org.apache.solr.request.PHPSerializedResponseWriter.write(PHPSerializedResponseWriter.java:69)
> 	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)
> 
> This is only triggered when the searchComponent is added to the request 
> handler.
> 
> Cheers,
> 
> -- 
> Markus Jelsma - CTO - Openindex
> http://www.linkedin.com/in/markus17
> 050-8536620 / 06-50258350

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem docs using Solr/Lucene:
http://www.lucidimagination.com/search