Hi Łukasz

CXF-5566 seems to be a different issue (and we did not get back to the bottom of why IllegalStateException was thrown in some cases - my only suspicion was that it was related to Jetty versions or possibly something else possibly due to some Camel CXFRS dependencies).

The properties can be set in jaxrs:server/jaxrs:properties in Blueprint/Spring.

You refer to workarounds, but I'm not sure what the issue is. Can it be that the third-party client you are using is closing the connections too early ? That would explain it - given that you can not reproduce
the issue with SoapUI or CXF RS client code

Cheers, Sergey
On 11/01/16 14:49, Łukasz Biały wrote:
Hi Sergey,

I'm not updating the objects from my application while responding. I'm
rather returning a list of objects almost directly from my database. But I
can try to do some synchronization to check if it helps.

I saw that there is already an issue reported for this problem:
https://issues.apache.org/jira/browse/CXF-5566.
What makes me wonder is that I cannot reproduce this error when the server
is running on a windows environment.
On linux it is relatively easy to reproduce the error with the client
application we're developing, but when I tried to reproduce it with load
tests (SOAPUI or a small piece of code using cxf-rt-rs-client) I does not
occur.
This bug occurs when running on open-JDK as well as on the Oracle JDK.

In one comment in jira you mention the setting
"org.apache.cxf.transport.http_jetty.continuations.disable". I didn't
understand where I can change this setting. Is there a possibility to set
this via blueprint?

I'm also open to workarounds for this issue. I read somewhere that I could
switch jetty for another http module to avoid this, but I'm not sure if this
would have impact on  the performance...

Greetings
Łukasz Biały

-----Original Message-----
Sent: Monday, January 11, 2016 12:54 PM
To: [email protected]
Subject: Re: org.apache.cxf.interceptor.Fault: DISPATCHED,initial

Hi

It is difficult to suggest why an array is written OK in some cases but not
in other cases when the concurrency is high, my immediate thought that may
be the application data are being updated concurrently too which has some
side-effects on the write process

Cheers, Sergey
On 05/01/16 16:48, Łukasz Biały wrote:
Hi,

Hopefully this is the right mailing list.



I am having some trouble with CXF inside Karaf.


Sometimes, when the same REST is invoked concurrently at the same
moment I see the following exception in my log files:



2016-01-05 17:11:27,077 | ERROR | qtp1283154258-55 | JAXRSUtils
| 165 - org.apache.cxf.cxf-rt-frontend-jaxrs - 3.0.7 | Problem with
| writing
the data, class java.util.ArrayList, ContentType: application/json

2016-01-05 17:11:27,082 | WARN  | qtp1283154258-55 |
PhaseInterceptorChain
| 148 - org.apache.cxf.cxf-core - 3.0.7 | Interceptor for
{http://my.app/}MyRestEndpointImpl has thrown exception, unwinding now

org.apache.cxf.interceptor.Fault: DISPATCHED,initial

                  at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteExcept
ion(JA
XRSOutInterceptor.java:382)[165:org.apache.cxf.cxf-rt-frontend-jaxrs:3
.0.7]

                  at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(
JAXRSO
utInterceptor.java:257)[165:org.apache.cxf.cxf-rt-frontend-jaxrs:3.0.7
]

                  at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(J
AXRSOu
tInterceptor.java:118)[165:org.apache.cxf.cxf-rt-frontend-jaxrs:3.0.7]

                  at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAX
RSOutI
nterceptor.java:81)[165:org.apache.cxf.cxf-rt-frontend-jaxrs:3.0.7]

                  at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
rChain .java:307)[148:org.apache.cxf.cxf-core:3.0.7]

                  at
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(Outg
oingCh ainInterceptor.java:83)[148:org.apache.cxf.cxf-core:3.0.7]

                  at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
rChain .java:307)[148:org.apache.cxf.cxf-core:3.0.7]

                  at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitia
tionOb server.java:121)[148:org.apache.cxf.cxf-core:3.0.7]

                  at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractH
TTPDes
tination.java:251)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(S
ervlet
Controller.java:234)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at

org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.
java:208)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at

org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.
java:160)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpri
ngServ let.java:180)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Abs
tractH
TTPServlet.java:293)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTT
PServl et.java:217)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at
javax.servlet.http.HttpServlet.service(HttpServlet.java:575)[75:org.ap
ache.g eronimo.specs.geronimo-servlet_3.0_spec:1.0.0]

                  at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractH
TTPSer vlet.java:268)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7]

                  at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
[79:or g.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:
503)[7
9:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doH
andle(
HttpServiceServletHandler.java:69)[88:org.ops4j.pax.web.pax-web-jetty:
3.2.2]

                  at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.ja
va:137
)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java
:557)[
79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandle
r.java
:231)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903
]

                  at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandle
r.java
:1086)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v2014090
3]

                  at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(H
ttpSer viceContext.java:240)[88:org.ops4j.pax.web.pax-web-jetty:3.2.2]

                  at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:4
29)[79 :org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at

org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:
193)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at

org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:
1020)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903
]

                  at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.ja
va:135
)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.
handle

(JettyServerHandlerCollection.java:75)[88:org.ops4j.pax.web.pax-web-jetty:3.
2.2]

                  at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.
java:1
16)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.server.Server.handle(Server.java:370)[79:org.eclipse
.jetty .aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstract
HttpCo
nnection.java:494)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1
.16.v2
0140903]

                  at
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(Abstrac
tHttpC
onnection.java:971)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.
1.16.v
20140903]

                  at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerC
omplet
e(AbstractHttpConnection.java:1033)[79:org.eclipse.jetty.aggregate.jet
ty-all
-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)[79:or
g.ecli pse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[
79:org .eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnectio
n.java
:82)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at

org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.
java:696)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v2014
0903]

                  at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndP
oint.j
ava:53)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v201409
03]

                  at

org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:
608)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.
java:5
43)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]

Caused by: java.lang.IllegalStateException: DISPATCHED,initial

                  at
org.eclipse.jetty.server.AsyncContinuation.handling(AsyncContinuation.
java:3
37)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstract
HttpCo
nnection.java:452)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.1
.16.v2
0140903]

                  at
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(Abstrac
tHttpC
onnection.java:971)[79:org.eclipse.jetty.aggregate.jetty-all-server:8.
1.16.v
20140903]

                  at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerC
omplet
e(AbstractHttpConnection.java:1033)[79:org.eclipse.jetty.aggregate.jet
ty-all
-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)[79:or
g.ecli pse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.http.HttpParser.available(HttpParser.java:1234)[79:o
rg.ecl ipse.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.eclipse.jetty.server.HttpInput.available(HttpInput.java:73)[79:org
.eclip se.jetty.aggregate.jetty-all-server:8.1.16.v20140903]

                  at
org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:183)[148:org.apache.c
xf.cxf
-core:3.0.7]

                  at
org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:142)[148:org.apache.c
xf.cxf
-core:3.0.7]

                  at
org.apache.cxf.io.DelegatingInputStream.cacheInput(DelegatingInputStre
am.jav a:54)[148:org.apache.cxf.cxf-core:3.0.7]

                  at
org.apache.cxf.transport.http.AbstractHTTPDestination$1.cacheInput(Abs
tractH
TTPDestination.java:308)[158:org.apache.cxf.cxf-rt-transports-http:3.0
.7]

                  at
org.apache.cxf.transport.http.AbstractHTTPDestination.cacheInput(Abstr
actHTT
PDestination.java:582)[158:org.apache.cxf.cxf-rt-transports-http:3.0.7
]

                  at
org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(Abs
tractH
TTPDestination.java:604)[158:org.apache.cxf.cxf-rt-transports-http:3.0
.7]

                  at
org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(Abs
tractH
TTPDestination.java:597)[158:org.apache.cxf.cxf-rt-transports-http:3.0
.7]

                  at
org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStr
eam.on
FirstWrite(AbstractHTTPDestination.java:775)[158:org.apache.cxf.cxf-rt
-trans
ports-http:3.0.7]

                  at
org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOut
putStr eam.java:47)[148:org.apache.cxf.cxf-core:3.0.7]

                  at
org.codehaus.jackson.impl.Utf8Generator._flushBuffer(Utf8Generator.jav
a:1754
)[209:jackson-core-asl:1.9.5]

                  at
org.codehaus.jackson.impl.Utf8Generator.flush(Utf8Generator.java:1088)
[209:j
ackson-core-asl:1.9.5]

                  at
org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:161
5)[210
:jackson-mapper-asl:1.9.5]

                  at
org.codehaus.jackson.jaxrs.JacksonJsonProvider.writeTo(JacksonJsonProv
ider.j
ava:558)[211:jackson-jaxrs:1.9.5]

                  at
org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java
:1381) [165:org.apache.cxf.cxf-rt-frontend-jaxrs:3.0.7]

                  at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(
JAXRSO
utInterceptor.java:235)[165:org.apache.cxf.cxf-rt-frontend-jaxrs:3.0.7
]

                  ... 41 more



The next REST invocation after this exception gets a random response,
from an unrelated REST method. Also there are timeouts when invoking
REST methods.
I would really appreciate some help with this issue, as aim out of
ideas on this one.


Greetings

Lukasz Bialy




--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to