(Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

(Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

Serdyn du Toit
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

Reply | Threaded
Open this post in threaded view
|

Re: (Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

Serdyn du Toit
Having similar problems in the latest Jetty 7 and latest Jetty 8.  I'm using a Jersey class (http://jersey.java.net/) to hit the Url with a http GET command - but when used external to Jetty there is zero problems with exactly the same code.
 
See below for the stacktrace from Jetty 8 after the webpage stalled for some time:

14:50:03.614 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close SCEP@38ba27{l(/127.0.0.1:26825)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConn
559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
14:50:03.615 [qtp9851613-10 Selector0] DEBUG org.eclipse.jetty.io.nio - destroyEndPoint SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,
}
14:50:03.615 [qtp9851613-10 Selector0] DEBUG o.e.j.server.AbstractHttpConnection - closed AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1
Mar 18, 2012 12:50:03 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:484)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
        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:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:347)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
        at java.lang.Thread.run(Thread.java:722)

14:50:03.618 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] WARN  org.eclipse.jetty.server.Response - Committed before 500 null

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:484)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
        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:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:347)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
        at java.lang.Thread.run(Thread.java:722)

14:50:03.626 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class org.apache.solr.servlet.SolrDispatchFilter from WebAppClassLoader=solr@1fd0653
14:50:03.627 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] WARN  o.e.jetty.servlet.ServletHandler - /solr/select
java.lang.IllegalStateException: Committed
        at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1090) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.Response.sendError(Response.java:298) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:380) ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:283) ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337) ~[jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484) [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499) [jetty-security-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413) [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.Server.handle(Server.java:347) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
14:50:03.628 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.servlet.ServletHandler - (GET /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10)@24222809 org.eclipse.jetty.server.Request@1719c59
14:50:03.628 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.servlet.ServletHandler - Response already committed for handling java.lang.IllegalStateException: Committed
14:50:03.628 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG org.eclipse.jetty.server.Server - RESPONSE /solr/select  200
14:50:03.628 [qtp9851613-17] DEBUG org.eclipse.jetty.io.nio - EOF
org.eclipse.jetty.io.EofException: null
        at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:952) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpGenerator.complete(HttpGenerator.java:836) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.completeResponse(AbstractHttpConnection.java:609) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.Response.complete(Response.java:1188) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:543) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
Caused by: java.nio.channels.ClosedChannelException: null
        at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249) ~[na:1.7.0_03]
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440) ~[na:1.7.0_03]
        at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:292) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:344) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:343) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:319) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:879) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        ... 14 common frames omitted
14:50:03.629 [qtp9851613-17] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4-}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=3,h=8,b=-1,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}

On Sun, Mar 18, 2012 at 1:46 PM, Serdyn du Toit <[hidden email]> wrote:
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


Reply | Threaded
Open this post in threaded view
|

Re: (Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

googley
FOR THE LOVE OF GOD PLEASE UNSUBCRIBE ME!

On 18 March 2012 13:01, Serdyn du Toit <[hidden email]> wrote:
Having similar problems in the latest Jetty 7 and latest Jetty 8.  I'm using a Jersey class (http://jersey.java.net/) to hit the Url with a http GET command - but when used external to Jetty there is zero problems with exactly the same code.
 
See below for the stacktrace from Jetty 8 after the webpage stalled for some time:

14:50:03.614 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close SCEP@38ba27{l(/127.0.0.1:26825)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConn
559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
14:50:03.615 [qtp9851613-10 Selector0] DEBUG org.eclipse.jetty.io.nio - destroyEndPoint SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,
}
14:50:03.615 [qtp9851613-10 Selector0] DEBUG o.e.j.server.AbstractHttpConnection - closed AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1
Mar 18, 2012 12:50:03 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:484)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
        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:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:347)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
        at java.lang.Thread.run(Thread.java:722)

14:50:03.618 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] WARN  org.eclipse.jetty.server.Response - Committed before 500 null

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:484)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
        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:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:347)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
        at java.lang.Thread.run(Thread.java:722)

14:50:03.626 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class org.apache.solr.servlet.SolrDispatchFilter from WebAppClassLoader=solr@1fd0653
14:50:03.627 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] WARN  o.e.jetty.servlet.ServletHandler - /solr/select
java.lang.IllegalStateException: Committed
        at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1090) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.Response.sendError(Response.java:298) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:380) ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:283) ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337) ~[jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484) [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499) [jetty-security-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413) [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.Server.handle(Server.java:347) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
14:50:03.628 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.servlet.ServletHandler - (GET /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10)@24222809 org.eclipse.jetty.server.Request@1719c59
14:50:03.628 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG o.e.jetty.servlet.ServletHandler - Response already committed for handling java.lang.IllegalStateException: Committed
14:50:03.628 [qtp9851613-17 - /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10] DEBUG org.eclipse.jetty.server.Server - RESPONSE /solr/select  200
14:50:03.628 [qtp9851613-17] DEBUG org.eclipse.jetty.io.nio - EOF
org.eclipse.jetty.io.EofException: null
        at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:952) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpGenerator.complete(HttpGenerator.java:836) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.completeResponse(AbstractHttpConnection.java:609) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.Response.complete(Response.java:1188) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:543) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
        at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
Caused by: java.nio.channels.ClosedChannelException: null
        at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249) ~[na:1.7.0_03]
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440) ~[na:1.7.0_03]
        at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:292) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:344) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:343) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:319) ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
        at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:879) ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
        ... 14 common frames omitted
14:50:03.629 [qtp9851613-17] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4-}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=3,h=8,b=-1,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}

On Sun, Mar 18, 2012 at 1:46 PM, Serdyn du Toit <[hidden email]> wrote:
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



Reply | Threaded
Open this post in threaded view
|

Re: (Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

Jan Bartel-3
In reply to this post by Serdyn du Toit
Serdyn,

Could we see the code that does the GET? More importantly, can you
also post a tcpdump of the request working correctly, and a tcpdump of
the request not working?

thanks
Jan

On 19 March 2012 00:01, Serdyn du Toit <[hidden email]> wrote:

> Having similar problems in the latest Jetty 7 and latest Jetty 8.  I'm using
> a Jersey class (http://jersey.java.net/) to hit the Url with a http GET
> command - but when used external to Jetty there is zero problems with
> exactly the same code.
>
> See below for the stacktrace from Jetty 8 after the webpage stalled for some
> time:
>
> 14:50:03.614 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(/127.0.0.1:26825)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConn
> 559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG org.eclipse.jetty.io.nio -
> destroyEndPoint
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,
> }
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG
> o.e.j.server.AbstractHttpConnection - closed
> AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1
> Mar 18, 2012 12:50:03 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.618 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  org.eclipse.jetty.server.Response - Committed before 500 null
>
> 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.626 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class
> org.apache.solr.servlet.SolrDispatchFilter from
> WebAppClassLoader=solr@1fd0653
> 14:50:03.627 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  o.e.jetty.servlet.ServletHandler - /solr/select
> java.lang.IllegalStateException: Committed
>         at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1090)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.sendError(Response.java:298)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:380)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:283)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
> ~[jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
> [jetty-security-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - (GET
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10)@24222809
> org.eclipse.jetty.server.Request@1719c59
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - Response already committed for
> handling java.lang.IllegalStateException: Committed
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG org.eclipse.jetty.server.Server - RESPONSE /solr/select  200
> 14:50:03.628 [qtp9851613-17] DEBUG org.eclipse.jetty.io.nio - EOF
> org.eclipse.jetty.io.EofException: null
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:952)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.complete(HttpGenerator.java:836)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.completeResponse(AbstractHttpConnection.java:609)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.complete(Response.java:1188)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:543)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> Caused by: java.nio.channels.ClosedChannelException: null
>         at
> sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249)
> ~[na:1.7.0_03]
>         at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440)
> ~[na:1.7.0_03]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:292)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:344)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:343)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:319)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:879)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         ... 14 common frames omitted
> 14:50:03.629 [qtp9851613-17] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4-}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=3,h=8,b=-1,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
>
> On Sun, Mar 18, 2012 at 1:46 PM, Serdyn du Toit <[hidden email]> wrote:
>>
>> 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
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: (Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

Serdyn du Toit
Hi Jan,

Since my previous post I've deployed the webapplication to Jetty on port 8080 and Solr to another Jetty instance on port 8081 - but the same behavior was evident.

FEEDBACK ON TCPDUMP:
--------------------------------------
Please see the attached text files for tcpdump contents (as I'm using Windows I used a Windows application to do this: http://www.microolap.com/products/network/tcpdump/).

I'm not a tcpdump expert - but it seems that in the one case the Solr application on port 8081 communicates the following:
16:43:58.310506 IP serdyn-PC.8081 > serdyn-PC.32804: Flags [S.], seq 1, ack 2, win 32768, length 0
And then adamantly refuses to communicate any further...

FEEDBACK ON CODE:
-------------------------------

My code using Jersey to do the GET is below.  The media type received from Solr is Json.

import java.net.URI;
import javax.ws.rs.core.MediaType;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;

<snip>  Code that takes the url and attempts to communicate

WebResource webResource = getWebResource(uriPath);
ClientResponse clientResponse = webResource.type(mediaType)
.get(ClientResponse.class);
return clientResponse;

<snip> The getWebResource(String) method used by the previous code segment

private WebResource getWebResource(String uriPath) throws Exception
{
URI uri = new URI(uriPath);
ClientConfig clientConfig = new DefaultClientConfig();
Client client = Client.create(clientConfig);
WebResource webResource = client.resource(uri);
return webResource;
}

Much appreciated.
Serdyn du Toit


On Mon, Mar 19, 2012 at 2:05 AM, Jan Bartel <[hidden email]> wrote:
Serdyn,

Could we see the code that does the GET? More importantly, can you
also post a tcpdump of the request working correctly, and a tcpdump of
the request not working?

thanks
Jan

On 19 March 2012 00:01, Serdyn du Toit <[hidden email]> wrote:
> Having similar problems in the latest Jetty 7 and latest Jetty 8.  I'm using
> a Jersey class (http://jersey.java.net/) to hit the Url with a http GET
> command - but when used external to Jetty there is zero problems with
> exactly the same code.
>
> See below for the stacktrace from Jetty 8 after the webpage stalled for some
> time:
>
> 14:50:03.614 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(/127.0.0.1:26825)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConn
> 559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG org.eclipse.jetty.io.nio -
> destroyEndPoint
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,
> }
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG
> o.e.j.server.AbstractHttpConnection - closed
> AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1
> Mar 18, 2012 12:50:03 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.618 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  org.eclipse.jetty.server.Response - Committed before 500 null
>
> 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.626 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class
> org.apache.solr.servlet.SolrDispatchFilter from
> WebAppClassLoader=solr@1fd0653
> 14:50:03.627 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  o.e.jetty.servlet.ServletHandler - /solr/select
> java.lang.IllegalStateException: Committed
>         at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1090)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.sendError(Response.java:298)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:380)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:283)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
> ~[jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
> [jetty-security-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - (GET
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10)@24222809
> org.eclipse.jetty.server.Request@1719c59
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - Response already committed for
> handling java.lang.IllegalStateException: Committed
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG org.eclipse.jetty.server.Server - RESPONSE /solr/select  200
> 14:50:03.628 [qtp9851613-17] DEBUG org.eclipse.jetty.io.nio - EOF
> org.eclipse.jetty.io.EofException: null
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:952)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.complete(HttpGenerator.java:836)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.completeResponse(AbstractHttpConnection.java:609)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.complete(Response.java:1188)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:543)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> Caused by: java.nio.channels.ClosedChannelException: null
>         at
> sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249)
> ~[na:1.7.0_03]
>         at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440)
> ~[na:1.7.0_03]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:292)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:344)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:343)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:319)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:879)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         ... 14 common frames omitted
> 14:50:03.629 [qtp9851613-17] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4-}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=3,h=8,b=-1,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
>
> On Sun, Mar 18, 2012 at 1:46 PM, Serdyn du Toit <[hidden email]> wrote:
>>
>> 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
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

serdyn-deployed-environment-tcpdump.txt (1K) Download Attachment
serdyn-java-testcase-tcpdump.txt (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: (Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

Serdyn du Toit
Hi,

I've refactored the code to use straight normal Java - the observed behavior was the same and the error didn't disappear.  The tcpdump behavior was the same - one tcpdump line from port 8081 and then quiet.  So it can't be a problem with the Jersey implementation.

The code using straight normal Java is as follows:

String jsonResponse = "";
{
URLConnection urlConnection = new URL(uri).openConnection();
        BufferedReader br = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
        String inputLine = null;
        while ((inputLine = br.readLine()) != null) 
    jsonResponse += inputLine;
        br.close();
}

When I hardcode the Url to www.google.com (as a test) it worked fine in the deployed environment - so it seems that there is some low-level issue with the connection handling when I'm trying to communicate with Solr from within Jetty.

Server log with a Url hardcoded to www.google.com:
2012-03-19 18:28:29,052 [qtp19943008-17] TRACE java.lang.Class - Solr query request:
2012-03-19 18:28:31,890 [qtp19943008-17] TRACE java.lang.Class - Solr query response as Json: <!doctype html> etcetera etcetera etcetera  
(Ie it gets a response)

Kind regards,
Serdyn


On Mon, Mar 19, 2012 at 5:19 PM, Serdyn du Toit <[hidden email]> wrote:
Hi Jan,

Since my previous post I've deployed the webapplication to Jetty on port 8080 and Solr to another Jetty instance on port 8081 - but the same behavior was evident.

FEEDBACK ON TCPDUMP:
--------------------------------------
Please see the attached text files for tcpdump contents (as I'm using Windows I used a Windows application to do this: http://www.microolap.com/products/network/tcpdump/).

I'm not a tcpdump expert - but it seems that in the one case the Solr application on port 8081 communicates the following:
16:43:58.310506 IP serdyn-PC.8081 > serdyn-PC.32804: Flags [S.], seq 1, ack 2, win 32768, length 0
And then adamantly refuses to communicate any further...

FEEDBACK ON CODE:
-------------------------------

My code using Jersey to do the GET is below.  The media type received from Solr is Json.

import java.net.URI;
import javax.ws.rs.core.MediaType;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;

<snip>  Code that takes the url and attempts to communicate

WebResource webResource = getWebResource(uriPath);
ClientResponse clientResponse = webResource.type(mediaType)
.get(ClientResponse.class);
return clientResponse;

<snip> The getWebResource(String) method used by the previous code segment

private WebResource getWebResource(String uriPath) throws Exception
{
URI uri = new URI(uriPath);
ClientConfig clientConfig = new DefaultClientConfig();
Client client = Client.create(clientConfig);
WebResource webResource = client.resource(uri);
return webResource;
}

Much appreciated.
Serdyn du Toit


On Mon, Mar 19, 2012 at 2:05 AM, Jan Bartel <[hidden email]> wrote:
Serdyn,

Could we see the code that does the GET? More importantly, can you
also post a tcpdump of the request working correctly, and a tcpdump of
the request not working?

thanks
Jan

On 19 March 2012 00:01, Serdyn du Toit <[hidden email]> wrote:
> Having similar problems in the latest Jetty 7 and latest Jetty 8.  I'm using
> a Jersey class (http://jersey.java.net/) to hit the Url with a http GET
> command - but when used external to Jetty there is zero problems with
> exactly the same code.
>
> See below for the stacktrace from Jetty 8 after the webpage stalled for some
> time:
>
> 14:50:03.614 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(/127.0.0.1:26825)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConn
> 559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG org.eclipse.jetty.io.nio -
> destroyEndPoint
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,
> }
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG
> o.e.j.server.AbstractHttpConnection - closed
> AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1
> Mar 18, 2012 12:50:03 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.618 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  org.eclipse.jetty.server.Response - Committed before 500 null
>
> 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.626 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class
> org.apache.solr.servlet.SolrDispatchFilter from
> WebAppClassLoader=solr@1fd0653
> 14:50:03.627 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  o.e.jetty.servlet.ServletHandler - /solr/select
> java.lang.IllegalStateException: Committed
>         at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1090)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.sendError(Response.java:298)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:380)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:283)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
> ~[jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
> [jetty-security-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - (GET
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10)@24222809
> org.eclipse.jetty.server.Request@1719c59
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - Response already committed for
> handling java.lang.IllegalStateException: Committed
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG org.eclipse.jetty.server.Server - RESPONSE /solr/select  200
> 14:50:03.628 [qtp9851613-17] DEBUG org.eclipse.jetty.io.nio - EOF
> org.eclipse.jetty.io.EofException: null
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:952)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.complete(HttpGenerator.java:836)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.completeResponse(AbstractHttpConnection.java:609)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.complete(Response.java:1188)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:543)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> Caused by: java.nio.channels.ClosedChannelException: null
>         at
> sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249)
> ~[na:1.7.0_03]
>         at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440)
> ~[na:1.7.0_03]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:292)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:344)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:343)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:319)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:879)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         ... 14 common frames omitted
> 14:50:03.629 [qtp9851613-17] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4-}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=3,h=8,b=-1,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
>
> On Sun, Mar 18, 2012 at 1:46 PM, Serdyn du Toit <[hidden email]> wrote:
>>
>> 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
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: (Jetty 8.0.4 and Solr) Can't call *functional* Solr endpoints

Serdyn du Toit
In reply to this post by Serdyn du Toit
Hi,

I've refactored the code to use straight normal Java - the observed behavior was the same and the error didn't disappear.  The tcpdump behavior was the same - one tcpdump line from port 8081 and then quiet.  So it can't be a problem with the Jersey implementation.

The code using straight normal Java is as follows:

String jsonResponse = "";
{
URLConnection urlConnection = new URL(uri).openConnection();
        BufferedReader br = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
        String inputLine = null;
        while ((inputLine = br.readLine()) != null) 
    jsonResponse += inputLine;
        br.close();
}

Kind regards,
Serdyn


On Mon, Mar 19, 2012 at 5:19 PM, Serdyn du Toit <[hidden email]> wrote:
Hi Jan,

Since my previous post I've deployed the webapplication to Jetty on port 8080 and Solr to another Jetty instance on port 8081 - but the same behavior was evident.

FEEDBACK ON TCPDUMP:
--------------------------------------
Please see the attached text files for tcpdump contents (as I'm using Windows I used a Windows application to do this: http://www.microolap.com/products/network/tcpdump/).

I'm not a tcpdump expert - but it seems that in the one case the Solr application on port 8081 communicates the following:
16:43:58.310506 IP serdyn-PC.8081 > serdyn-PC.32804: Flags [S.], seq 1, ack 2, win 32768, length 0
And then adamantly refuses to communicate any further...

FEEDBACK ON CODE:
-------------------------------

My code using Jersey to do the GET is below.  The media type received from Solr is Json.

import java.net.URI;
import javax.ws.rs.core.MediaType;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;

<snip>  Code that takes the url and attempts to communicate

WebResource webResource = getWebResource(uriPath);
ClientResponse clientResponse = webResource.type(mediaType)
.get(ClientResponse.class);
return clientResponse;

<snip> The getWebResource(String) method used by the previous code segment

private WebResource getWebResource(String uriPath) throws Exception
{
URI uri = new URI(uriPath);
ClientConfig clientConfig = new DefaultClientConfig();
Client client = Client.create(clientConfig);
WebResource webResource = client.resource(uri);
return webResource;
}

Much appreciated.
Serdyn du Toit


On Mon, Mar 19, 2012 at 2:05 AM, Jan Bartel <[hidden email]> wrote:
Serdyn,

Could we see the code that does the GET? More importantly, can you
also post a tcpdump of the request working correctly, and a tcpdump of
the request not working?

thanks
Jan

On 19 March 2012 00:01, Serdyn du Toit <[hidden email]> wrote:
> Having similar problems in the latest Jetty 7 and latest Jetty 8.  I'm using
> a Jersey class (http://jersey.java.net/) to hit the Url with a http GET
> command - but when used external to Jetty there is zero problems with
> exactly the same code.
>
> See below for the stacktrace from Jetty 8 after the webpage stalled for some
> time:
>
> 14:50:03.614 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(/127.0.0.1:26825)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConn
> 559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG org.eclipse.jetty.io.nio -
> destroyEndPoint
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4!}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,
> }
> 14:50:03.615 [qtp9851613-10 Selector0] DEBUG
> o.e.j.server.AbstractHttpConnection - closed
> AsyncHttpConnection@4559a1,g=HttpGenerator{s=2,h=0,b=0,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1
> Mar 18, 2012 12:50:03 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.618 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  org.eclipse.jetty.server.Response - Committed before 500 null
>
> 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:484)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
>         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:111)
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
>         at java.lang.Thread.run(Thread.java:722)
>
> 14:50:03.626 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class
> org.apache.solr.servlet.SolrDispatchFilter from
> WebAppClassLoader=solr@1fd0653
> 14:50:03.627 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> WARN  o.e.jetty.servlet.ServletHandler - /solr/select
> java.lang.IllegalStateException: Committed
>         at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1090)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.sendError(Response.java:298)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:380)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:283)
> ~[apache-solr-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:54:38]
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
> ~[jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
> [jetty-security-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
> [jetty-servlet-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Server.handle(Server.java:347)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> [jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> [jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - (GET
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10)@24222809
> org.eclipse.jetty.server.Request@1719c59
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG o.e.jetty.servlet.ServletHandler - Response already committed for
> handling java.lang.IllegalStateException: Committed
> 14:50:03.628 [qtp9851613-17 -
> /solr/select?wt=json&indent=true&q=text:sushi&sort=id+desc&start=0&rows=10]
> DEBUG org.eclipse.jetty.server.Server - RESPONSE /solr/select  200
> 14:50:03.628 [qtp9851613-17] DEBUG org.eclipse.jetty.io.nio - EOF
> org.eclipse.jetty.io.EofException: null
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:952)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.complete(HttpGenerator.java:836)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.completeResponse(AbstractHttpConnection.java:609)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.server.Response.complete(Response.java:1188)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:543)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> ~[jetty-server-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> [jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> [jetty-util-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
> Caused by: java.nio.channels.ClosedChannelException: null
>         at
> sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249)
> ~[na:1.7.0_03]
>         at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440)
> ~[na:1.7.0_03]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:292)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:344)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:343)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:319)
> ~[jetty-io-8.1.2.v20120308.jar:8.1.2.v20120308]
>         at
> org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:879)
> ~[jetty-http-8.1.2.v20120308.jar:8.1.2.v20120308]
>         ... 14 common frames omitted
> 14:50:03.629 [qtp9851613-17] DEBUG o.e.jetty.io.nio.ChannelEndPoint - close
> SCEP@38ba27{l(null)<->r(0.0.0.0/0.0.0.0:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=4-}-{AsyncHttpConnection@4559a1,g=HttpGenerator{s=3,h=8,b=-1,c=8192},p=HttpParser{s=-5,l=10,c=0},r=1}
>
> On Sun, Mar 18, 2012 at 1:46 PM, Serdyn du Toit <[hidden email]> wrote:
>>
>> 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
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email