camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shing Hing Man <mat...@yahoo.com>
Subject Sometimes HttpResponse close too early
Date Wed, 05 Feb 2014 20:12:04 GMT
Hi,

I am using Camel 2.11. 


I have a  Camel endpoint that uses jetty:http to listen to http request

The http requests are routed to a processor and after some processing, a pixel is sentback
to the client, via Http Response.

AbstractJSCollector.java : 

public void setResponse(HttpServletResponse response) throws Exception {
        response.setContentType("image/png");
        OutputStream os = response.getOutputStream();
        ImageIO.write(pixel, "png", os);

    }

Occasionally, I get the following exception.


2014-02-05 19:41:23,468  [qtp1767800486-19] ERROR  o.a.c.processor.DefaultErrorHandler - Failed
delivery for (MessageId: ID-msgbusdev-54317-1391625742336-0-68228 on ExchangeId: ID-msgbusdev-54317-1391625742336-0-68227).
Exhausted after delivery attempt: 4 caught: org.eclipse.jetty.io.EofException. Processed by
failure processor: FatalFallbackErrorHandler[Channel[sendTo(Endpoint[log://jsCollectorDataTo])]]
org.eclipse.jetty.io.EofException: null
at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:914) ~[jetty-http-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.http.AbstractGenerator.flush(AbstractGenerator.java:443) ~[jetty-http-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.HttpOutput.flush(HttpOutput.java:100) ~[jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.AbstractHttpConnection$Output.flush(AbstractHttpConnection.java:1072)
~[jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at javax.imageio.stream.FileCacheImageOutputStream.close(FileCacheImageOutputStream.java:238)
~[na:1.7.0_40]
at javax.imageio.ImageIO.write(ImageIO.java:1580) ~[na:1.7.0_40]
at com.adbrain.messagebus.jscollector.AbstractJSCollectorProcessor.setResponse(AbstractJSCollectorProcessor.java:38)
~[messagebus-2.0-SNAPSHOT.jar:na]
at com.adbrain.messagebus.jscollector.JSCollectorDataProcessor.process(JSCollectorDataProcessor.java:80)
~[messagebus-2.0-SNAPSHOT.jar:na]
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
~[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:391)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
[camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.11.1.jar:2.11.1]
at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:60) [camel-core-2.11.1.jar:2.11.1]
Caused by: java.nio.channels.ClosedChannelException: null
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:267) ~[na:1.7.0_40]
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:512) ~[na:1.7.0_40]
at java.nio.channels.SocketChannel.write(SocketChannel.java:493) ~[na:1.7.0_40]
at org.eclipse.jetty.io.nio.ChannelEndPoint.gatheringFlush(ChannelEndPoint.java:376) ~[jetty-io-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:335) ~[jetty-io-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:336) [jetty-io-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:838) ~[jetty-http-7.6.8.v20121106.jar:7.6.8.v20121106]
... 100 common frames omitted
2014-02-05 19:41:23,471  [qtp1767800486-19] ERROR  o.a.c.c.j.CamelContinuationServlet - Error
processing request
java.lang.IllegalStateException: STREAM
at org.eclipse.jetty.server.Response.getWriter(Response.java:689) ~[jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.apache.camel.component.http.DefaultHttpBinding.doWriteExceptionResponse(DefaultHttpBinding.java:252)
~[camel-http-2.11.1.jar:2.11.1]
at org.apache.camel.component.http.DefaultHttpBinding.writeResponse(DefaultHttpBinding.java:218)
~[camel-http-2.11.1.jar:2.11.1]
at org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:175)
~[camel-jetty-2.11.1.jar:2.11.1]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) [javax.servlet-2.5.0.v201103041518.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652) [jetty-servlet-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329)
[jetty-servlet-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.apache.camel.component.jetty.CamelFilterWrapper.doFilter(CamelFilterWrapper.java:46)
[camel-jetty-2.11.1.jar:2.11.1]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[jetty-servlet-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445) [jetty-servlet-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038) [jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374) [jetty-servlet-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972) [jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.Server.handleAsync(Server.java:403) [jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:488)
[jetty-server-7.6.8.v20121106.jar:7.6.8.v20121106]



It seems that the Http Response stream somehow has closed when I set a pixel. 

What could cause the Http  Response stream to close early ?

Thanks in advance for any assistance !

Shing
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message