[jetty-user] (Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

Serdyn du Toit <[email protected]> Sun, 18 Mar 2012 13:46:57 +0200
Newsgroups gmane.comp.java.jetty.support
Message-ID <CAN25sN+ZeCEgLh5ZHRi-Ef8YKvJTbpaq6RfLi0b9H0yf2e4MtQ@mail.gmail.com>
Hi,

I'm having problems accessing Solr from Jetty.

My webapplication is deployed as is Solr - currently still in the same
Jetty instance.

Some preliminaries:
1) Accessing my webapplication works 100%.
2) Accessing Solr works 100%. I can access the Solr admin interface and
execute a search (through an url eg
http://localhost:8080/solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10).
 Accessing the search url works 100% from a Java testcase and when I use it
in my browser.

The problem:
When I try to use THE SAME JAVA CODE now just in my deployed webapplication
in Jetty - it no longer works.

I get the following error:
Mar 18, 2012 1:22:18 PM org.apache.solr.common.SolrException log
SEVERE: org.eclipse.jetty.io.EofException
        at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:154)
        at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:101)
        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
        at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)
        at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
        at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)
        at
org.apache.solr.common.util.FastWriter.flushBuffer(FastWriter.java:125)
        at
org.apache.solr.response.TextResponseWriter.close(TextResponseWriter.java:68)
        at
org.apache.solr.response.JSONResponseWriter.write(JSONResponseWriter.java:58)
        at
org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:343)
        at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:265)
        at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
        at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
        at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
        at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
        at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
        at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
        at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
        at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
        at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
        at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
        at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
        at org.eclipse.jetty.server.Server.handle(Server.java:350)
        at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
        at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)
        at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
        at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
        at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
        at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
        at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
        at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
        at java.lang.Thread.run(Thread.java:722)

I think there might be a problem in Jetty as like I said - it works 100%
with exactly the same code if I access it outside of Jetty.  Not sure if
there is security settings I need to set for access from one webapplication
to another - but it doesn't make sense as I'm just hitting a Url...

Any help appreciated.
Serdyn du Toit