Same problem here with much smaller PDF and Tomcat 6.0.2 :
As you could see the problem occurs between 81920 and 90112 bytes sent ;( The problem may be related to Apache2 level, since I've got this problem on some Suse SLES 9 system where Apache2 RPM is not up to date. file to be sent is 162748 long, iosize=8192 lReadLen=8192 lSentLen=8192 lReadLen=8192 lSentLen=16384 lReadLen=8192 lSentLen=24576 lReadLen=8192 lSentLen=32768 lReadLen=8192 lSentLen=40960 lReadLen=8192 lSentLen=49152 lReadLen=8192 lSentLen=57344 lReadLen=8192 lSentLen=65536 lReadLen=8192 lSentLen=73728 lReadLen=8192 lSentLen=81920 lReadLen=8192 stackTrace is ClientAbortException: java.io.IOException at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:357) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:380) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:369) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) 2006/12/5, Haroon Rafique <[EMAIL PROTECTED]>:
Hi Devs, I sent this to the user list without any responses. I am looking for some insight from the dev list. You can also see the nabble archive of the user-list posting at http://www.nabble.com/mod_jk-problem-when-streaming-files-larger-than-%7E400k-%28causes-ClientAbortException%29-t2756411.html If I don't get any responses, then I can submit a bugzilla bug with a "testcase" war file and its source (maven driven) so that the devs can play around with it. Cheers, -- Haroon Rafique <[EMAIL PROTECTED]> ---------- Forwarded message ---------- Date: Mon, 4 Dec 2006 15:01:19 -0500 (EST) From: Haroon Rafique <[EMAIL PROTECTED]> To: users@tomcat.apache.org Subject: mod_jk problem when streaming files larger than ~400k (causes ClientAbortException) Hi, I am using mod_jk 1.2.19 on Linux with JDK 1.5.0_08, tomcat 5.5.20. Our application is struts-based and in one of our actions we stream a PDF to the client. The pseudo-code for outputting the response back to the client is as follows (assuming baos contains a ByteArrayOutputStream): OutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush(); out.close(); We noticed no problems when the size of baos was less than 400k. Now the filesize has jumped to a little greater than 400k. With mod_jk in the picture, intermittently (not all the time), we get ClientAbortException: Caused by: ClientAbortException: java.io.IOException at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366) The end result being that the PDF is truncated and Acrobat considers it damaged. Without mod_jk in the picture, everything is fine. Turning up the mod_jk logging to debug gave me too much info. Turning it down to info gave me some clues. Basically, there are 3 flavors of the failures. Maybe they are all the same but it might appear different to a trained eye, so I'm posting all three. Flavor 1 error: =============== [Mon Dec 04 14:28:59 2006] [25445:9920] [info] ajp_connection_tcp_get_message:: jk_ajp_common.c (941): (local) Tomcat has forced a connection close for socket 22 [Mon Dec 04 14:28:59 2006] [25445:9920] [error] ajp_get_reply::jk_ajp_common.c (1562): (local) Tomcat is down or network problems. Part of the response has already been sent to the client [Mon Dec 04 14:28:59 2006] [25445:9920] [info] ajp_service::jk_ajp_common.c (18 28): (local) receiving from tomcat failed, recoverable operation attempt=0 [Mon Dec 04 14:28:59 2006] [25445:9920] [info] ajp_service::jk_ajp_common.c (1867): (local) sending request to tomcat failed, recoverable operation attempt=1 [Mon Dec 04 14:28:59 2006] [25445:9920] [info] ajp_process_callback::jk_ajp_common.c (1410): Writing to client aborted or client network problems [Mon Dec 04 14:28:59 2006] [25445:9920] [info] ajp_service::jk_ajp_common.c (1795): (local) request failed, because of client write error without recovery in send loop attempt=1 [Mon Dec 04 14:28:59 2006] [25445:9920] [info] jk_handler::mod_jk.c (2056): Aborting connection for worker=local Flavor 2 error: =============== [Mon Dec 04 14:30:30 2006] [25448:9920] [info] ajp_send_request::jk_ajp_common.c (1170): (local) socket 22 is not connected any more (errno=0) [Mon Dec 04 14:30:30 2006] [25448:9920] [info] ajp_send_request::jk_ajp_common.c (1194): (local) error sending request. Will try another pooled connection [Mon Dec 04 14:30:30 2006] [25448:9920] [info] ajp_send_request::jk_ajp_common.c (1218): (local) all endpoints are disconnected or dead [Mon Dec 04 14:30:30 2006] [25448:9920] [info] ajp_service::jk_ajp_common.c (1867): (local) sending request to tomcat failed, recoverable operation attempt=1 [Mon Dec 04 14:30:32 2006] [25448:9920] [info] ajp_connection_tcp_get_message::jk_ajp_common.c (941): (local) Tomcat has forced a connection close for socket 22 [Mon Dec 04 14:30:32 2006] [25448:9920] [error] ajp_get_reply::jk_ajp_common.c (1562): (local) Tomcat is down or network problems. Part of the response has already been sent to the client [Mon Dec 04 14:30:32 2006] [25448:9920] [info] ajp_service::jk_ajp_common.c (1828): (local) receiving from tomcat failed, recoverable operation attempt=1 [Mon Dec 04 14:30:32 2006] [25448:9920] [info] ajp_service::jk_ajp_common.c (1867): (local) sending request to tomcat failed, recoverable operation attempt=2 [Mon Dec 04 14:30:32 2006] [25448:9920] [error] ajp_service::jk_ajp_common.c (1879): (local) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port [Mon Dec 04 14:30:32 2006] [25448:9920] [info] jk_handler::mod_jk.c (2063): Service error=0 for worker=local Flavor 3 error: =============== [Mon Dec 04 14:32:31 2006] [25444:9920] [info] ajp_send_request::jk_ajp_common.c (1170): (local) socket 22 is not connected any more (errno=0) [Mon Dec 04 14:32:31 2006] [25444:9920] [info] ajp_send_request::jk_ajp_common.c (1194): (local) error sending request. Will try another pooled connection [Mon Dec 04 14:32:31 2006] [25444:9920] [info] ajp_send_request::jk_ajp_common.c (1218): (local) all endpoints are disconnected or dead [Mon Dec 04 14:32:31 2006] [25444:9920] [info] ajp_service::jk_ajp_common.c (1867): (local) sending request to tomcat failed, recoverable operation attempt=1 Does anyone have any experience with streaming large files using mod_jk? If I don't get any responses I will try the dev list. Here's my mod_jk.conf: LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties JkLogFile logs/mod_jk.log JkLogLevel info JkShmFile logs/mod_jk.shm JkMount /jkstatus/ status JkMount /sws/* local Here's my workers.properties: worker.list=local,status worker.local.type=ajp13 worker.local.port=8009 worker.local.host=localhost worker.status.type=status worker.status.port=8009 worker.status.host=localhost Anyone see any glaring mistakes or oddities? As I mentioned earlier, the same setup worked fine. The only trigger that I can think of is the slight increase in file size. Any help appreciated. thanks, -- Haroon Rafique <[EMAIL PROTECTED]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]