IllegalStateException: Dispatch, initial

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

IllegalStateException: Dispatch, initial

lekkie
This post has NOT been accepted by the mailing list yet.
Hi all,

I got this exception on my Jetty server, what does it mean?


09:29:39,304 | WARN  | tp922596802-1973 | PhaseInterceptorChain            | 169 - org.apache.cxf.cxf-api - 2.6.0.fuse-71-047 | Interceptor for {http://techquest.interswitchng.com/}OTPServices has thrown exception, unwinding now
java.lang.IllegalStateException: DISPATCHED,initial
at org.eclipse.jetty.server.AsyncContinuation.handling(AsyncContinuation.java:292)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:444)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)[79:org.eclipse.jetty.http:7.6.7.v20120910]
        at org.eclipse.jetty.http.HttpParser.available(HttpParser.java:1225)[79:org.eclipse.jetty.http:7.6.7.v20120910]
        at org.eclipse.jetty.server.HttpInput.available(HttpInput.java:73)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:126)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:103)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.io.DelegatingInputStream.cacheInput(DelegatingInputStream.java:54)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http.AbstractHTTPDestination$1.cacheInput(AbstractHTTPDestination.java:275)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http.AbstractHTTPDestination.cacheInput(AbstractHTTPDestination.java:524)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:536)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:529)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.onFirstWrite(AbstractHTTPDestination.java:693)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
        at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100)[157:woodstox-core-asl:4.1.4]
        at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:225)[157:woodstox-core-asl:4.1.4]
        at com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:198)[157:woodstox-core-asl:4.1.4]
        at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1404)[157:woodstox-core-asl:4.1.4]
        at com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:536)[157:woodstox-core-asl:4.1.4]
        at org.apache.cxf.staxutils.StaxUtils.writeDocument(StaxUtils.java:731)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.staxutils.StaxUtils.writeDocument(StaxUtils.java:713)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:903)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.frontend.WSDLGetInterceptor.handleMessage(WSDLGetInterceptor.java:127)[179:org.apache.cxf.cxf-rt-frontend-simple:2.6.0.fuse-71-047]
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)[192:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)[192:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.fuse-71-047]
        at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)[192:org.apache.cxf.cxf-rt-transports-http-jetty:2.6.0.fuse-71-047]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1040)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:976)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.Server.handle(Server.java:363)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)[79:org.eclipse.jetty.http:7.6.7.v20120910]
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[79:org.eclipse.jetty.http:7.6.7.v20120910]
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[84:org.eclipse.jetty.server:7.6.7.v20120910]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)[81:org.eclipse.jetty.io:7.6.7.v20120910]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)[81:org.eclipse.jetty.io:7.6.7.v20120910]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[90:org.eclipse.jetty.util:7.6.7.v20120910]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[90:org.eclipse.jetty.util:7.6.7.v20120910]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]


Regards.
Reply | Threaded
Open this post in threaded view
|

Re: IllegalStateException: Dispatch, initial

ask4ralph
This post has NOT been accepted by the mailing list yet.
We experienced the same issue invoking a rest cxf web service from an Android client and decided to share how it was resolved.

The presence of multiple new line character (inserted by an encryption algorithm used) between consecutive headers seemed to be the problem. The error stopped when these empty lines were removed from the headers.

See Wireshark output below (Notice the extra lines immediately after the Signature and Authorization headers)

POST /api/v1/quickteller/users/user@gmail.com/authentications HTTP/1.1
Host: 172.25.20.56:9080
Timestamp: 1402997385
Nonce: 1063449687
Signature: RDM2MEQ5NkRCOEZBRjRENDc1REU5RUE1OUZDOTM2MTg2NjIxRDg3Mw==

Authorization: INTERSWITCHAUTH SUtJQTc2N0MxQkIxMDU1MUM4MzczNzBFNzQ5RENBQTI3NkYzMTkxMDk2NjQ=

SignatureMethod: SHA1
Content-Length: 13
Content-Type: application/x-www-form-urlencoded
Connection: Keep-Alive
User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)


password=motiHTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: Jetty(7.6.7.v20120910)


0


Hope this helps someone.