开发环境:windows+myEclipse8.0+tomcat6.0+mysql 用到的web框架:Struts2+Spriing3.0+hibernate3.0 部署环境:suse Linux+tomcat6.0+mysql,传输速度1M左右 具体操作如下: 选择文件进行上传时,文件大概是7.8M的XML,点击提交之后,无任何提示,直接跳转到“页面无法找到”如图 看tomcat的日志,在日志文件localhost-时间.log找到该异常: ClientAbortException: java.net.SocketException: Broken pipe at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:356) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:307) at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:286) at org.apache.catalina.connector.Response.flushBuffer(Response.java:541) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:211) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:817) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:623) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:444) at java.lang.Thread.run(Unknown Source) Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:772) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:123) at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:579) at org.apache.coyote.Response.doWrite(Response.java:559) at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:351) ... 13 more 然后在struts2指定的临时目录中找到了刚才上传的文件,只有8K左右 好像是链接被重置了,如果上传小于1k的文件没有该问题 我用Wireshark抓包工具抓了一下包,发现在收到几个包之后收到了rest包,这个问题解决了3天了毫无结果,那位大侠知道的话,请指点一下,小弟万分感激!
解决办法是在环境变量中设置:_JAVA_SR_SIGNUM=12 基本就可以解决。 sun的解释: --posted by: cooper Below is a clipping from Sun on working around JVM crashes under high thread counts in the JVM 1.3 for Linux
On Linux, use a larger signal number for hotspot thread suspension/resumption handler. The signal number being used is specified by environment variable _JAVA_SR_SIGNUM. Setting it to a number larger than SIGSEGV (11) will solve the problem. A good number to use is 12, which is SIGUSR2. Using signal 16 to work around the problem might have potential problems. So on tcsh, "setenv _JAVA_SR_SIGNUM 12" can solve the problem.