camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdomingo ...@domingo.nl>
Subject Re: bridging binary files over http
Date Mon, 12 Apr 2010 10:55:06 GMT

Damn, It seems I'm running in to a Java Bug :(

http://256.com/gray/docs/misc/java_bad_file_descriptor_close_bug.shtml



rdomingo wrote:
> 
> Hello,
> 
> 1 - I have a http service setup (using camel)
>         <route>
>             <from uri="jetty:http://0.0.0.0:9101/clipboard/download" />
>             <to uri="bean:clipboardBean?method=download" async="false" />
>         </route>
> 
> 2 - When I download a (txt or binary) file directly from this http
> service, download is ok.
> 
> 3 - When I add a http bridge between the service and downloader BINARY
> files can't be downloaded -> 0KB, text files still download ok.
>        <route>
>             <from
> uri="jetty:http://0.0.0.0:8201/clipboard?matchOnUriPrefix=true" />
>             <to uri="http://0.0.0.0:9101?bridgeEndpoint=true" />
>         </route>
> 
> How can I enable bridging of binary file downloads over HTTP ???
> 
> In my logging I see  an Exception:
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.available(Native Method)
> 	at
> org.apache.camel.converter.stream.FileInputStreamCache.available(FileInputStreamCache.java:70)
> 	at org.apache.camel.util.IOHelper.copy(IOHelper.java:85)
> 	at org.apache.camel.util.IOHelper.copy(IOHelper.java:81)
> 	at
> org.apache.camel.component.http.DefaultHttpBinding.doWriteDirectResponse(DefaultHttpBinding.java:183)
> 	at
> org.apache.camel.component.http.DefaultHttpBinding.doWriteResponse(DefaultHttpBinding.java:169)
> 	at
> org.apache.camel.component.http.DefaultHttpBinding.writeResponse(DefaultHttpBinding.java:116)
> 	at
> org.apache.camel.component.http.CamelServlet.service(CamelServlet.java:61)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> 	at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
> 	at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> 	at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:326)
> 	at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> 	at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> 	at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> 2010-04-08 15:37:45.911:WARN::/clipboard/download: java.io.IOException:
> Bad file descriptor
> 
> 
> Best regards,
> Raymond Domingo
> 

-- 
View this message in context: http://old.nabble.com/bridging-binary-files-over-http-tp28178639p28216208.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message