Hello,I have java application running on a Tomcat 6 server sitting behind an Apache HTTPD Server (Apache/2.2.8 (Linux/SUSE) mod_ssl/2.2.8 OpenSSL/0.9.8g). I'm experiencing problems uploading big files on it: after around 30 minutes (nearly exactly 30 minutes!) the upload stops. I've tried to solve them with several combinations but until now I didn't find any solution.
In the "standard" configuration I have Apache HTTPD with mod_ssl connected through *mod_proxy_ajp* to the *AJP Connector* of Tomcat.
Apache httpd-ssl.conf: <IfModule mod_proxy_ajp.c> ProxyRequests Off ProxyTimeout 3600 ProxyPass /error ! <Location / > ProxyPass ajp://172.31.252.17:8009/ ProxyPassReverse ajp://172.31.252.17:8009/ </Location> </IfModule> Tomcat server.xml file: <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />With this configuration I get a *FileUploadBase$IOFileUploadException* ("*Processing of multipart/form-data request failed. null*") with following stacktrace:
----------------------------org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) at ch.arpage.agora.util.MultiPartClassHandler.handleRequest(MultiPartClassHandler.java:220) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:442) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at ch.arpage.agora.util.strip.StripFilter.doFilter(StripFilter.java:82) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at ch.arpage.agora.util.compression.CompressionFilter.doFilter(CompressionFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:595) Caused by: java.io.IOExceptionat org.apache.jk.common.JkInputStream.receive(JkInputStream.java:199) at org.apache.jk.common.JkInputStream.refillReadBuffer(JkInputStream.java:258)
at org.apache.jk.common.JkInputStream.doRead(JkInputStream.java:177) at org.apache.coyote.Request.doRead(Request.java:428)at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304) at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405) at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327) at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)
at java.io.InputStream.read(InputStream.java:89) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)
... 30 more ---------------------------- On the Apache site (error_log) I see (with LogLevel info) following message:[info] [client 92.105.8.138] (70007)The timeout specified has expired: SSL input filter read failed.
If - instead of mod_ajp_proxy - I use *mod_http_proxy* connected to the *HTTP 1.1 connector*
<IfModule mod_proxy_http.c> ProxyRequests Off ProxyTimeout 3600 ProxyPass /error ! <Location / > ProxyPass http://172.31.252.17:8080/ ProxyPassReverse http://172.31.252.17:8080/ </Location> </IfModule> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />Than on the Tomcat site I also have a FileUploadBase$IOFileUploadException but with a different message "*Processing of multipart/form-data request failed. Stream ended unexpectedly*":
----------------------------org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) at ch.arpage.agora.util.MultiPartClassHandler.handleRequest(MultiPartClassHandler.java:220) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:442) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at ch.arpage.agora.util.strip.StripFilter.doFilter(StripFilter.java:82) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at ch.arpage.agora.util.compression.CompressionFilter.doFilter(CompressionFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:983) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)
at java.io.InputStream.read(InputStream.java:89) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)
... 27 more ---------------------------- and this time on the Apache error_log file following message appears:[error] proxy: pass request body failed to 172.31.252.17:8080 (172.31.252.17) from 172.31.252.1 ()
Uploading big files directly on tomcat without the Apache HTTPD "front-end" works fine. To make it work I had to update the connector configuration (property "*connectionUploadTimeout*") as follow:
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="600000" connectionUploadTimeout="3600000" disableUploadTimeout="true" redirectPort="8443" /> As I told you I tried several solution: * forcing in tomcat server.xml the parameter *disableUploadTimeout*=true * In Apache HTTPD setting the *Timeout* to 3600 seconds (1 hour) * In the proxy configuration setting following properties: *SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1* * Trying not to use HTTPS but connecting directly Apache on HTTP to Tomcat * Setting keepalive=Off on ProxyPass: ProxyPass ajp://localhost:8009/ keepalive=Off timeout=90000 * Setting the timeout on ProxyPass: ProxyPass ajp://localhost:8009/ timeout=3600 * Setting KeepAlive On, MaxKeepAliveRequests 500, KeepAliveTimeout 14400 However nothing seems to help: after 30 minutes the upload breaks down. To be honest I really don't know what to do.Our application has an upload progress indicator, which is updated every X seconds through AJAX calls: for this reason it's this not a problem of session-timeout, which is kept alive through this calls.
Our Server is running Solaris 10, but I've also tried on a Linux (SuSe) with exactly the same result.
I've posted this problem before also on the Tomcat User mailing list but I didn't find any solution. Since with tomcat alone the upload works fine I suppose it has to do with the HTTPD Server or one of its module...
Do you have any suggestion? Thanks a lot for your attention and your help. Best regards, Patrick Patrick Herber Lugano, Switzerland --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx