Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Catching on the server side

Hello list,

I hope somebody can point me in the right direction with the following. I already asked the Apache CXF user list ( but the few recommendations did not work. 

>>> copied from the post >>>

Think of a simple restful webservice which just echos the data - for sure the real WS is much more complex running on ServiceMix (4.5.3 with CXF 2.6.9). The answer is delayed by 15 seconds to simulate processing time. The test client calling the WS has a requestTimeout of 10 seconds. As expected the client drops the connection and throws an exception. On the server side the process waits until the 15 seconds are over and tries to send the data back to the client - which is not longer listening. As expected the server throws an IOException (connection reset by peer). 

The problem is that I want to catch this exception and forward the not delivered answer to a JMS queue.
<<< copied from the post <<<

I failed to get this managed with Apache CXF and I failed with Apache Camel.

Based on the stack trace I think CXF and Camel are already done and the IOException has to handled by Jetty.

16:17:23,333 | DEBUG | /rs/Echo/process | Server                           | 268 - org.eclipse.jetty.util - 7.5.4.v20111024 | RESPONSE /cxf/rs/Echo/process  200
16:17:23,333 | DEBUG | qtp1008596480-32 | ChannelEndPoint                  | 268 - org.eclipse.jetty.util - 7.5.4.v20111024 | Connection reset by peer
	at Method)[:1.7.0_55]
	at org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.fill([264:org.eclipse.jetty.server:7.5.4.v20111024]
	at org.eclipse.jetty.http.HttpParser.fill([265:org.eclipse.jetty.http:7.5.4.v20111024]
	at org.eclipse.jetty.http.HttpParser.parseNext([265:org.eclipse.jetty.http:7.5.4.v20111024]
	at org.eclipse.jetty.http.HttpParser.parseAvailable([265:org.eclipse.jetty.http:7.5.4.v20111024]
	at org.eclipse.jetty.server.BlockingHttpConnection.handle([264:org.eclipse.jetty.server:7.5.4.v20111024]
	at org.eclipse.jetty.server.nio.BlockingChannelConnector$[264:org.eclipse.jetty.server:7.5.4.v20111024]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob([268:org.eclipse.jetty.util:7.5.4.v20111024]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$[268:org.eclipse.jetty.util:7.5.4.v20111024]
16:17:23,334 | DEBUG | qtp1008596480-32 | HttpConnection                   | 268 - org.eclipse.jetty.util - 7.5.4.v20111024 | closed org.eclipse.jetty.server.BlockingHttpConnection@799e037@<->

So ..

(1) How can I catch the IOException in Jetty?

(2) Since I’m running ServiceMix 4.5.3 what is the procedure to get it done in this runtime?

Thanks for any help,

Back to the top