linux服务器上 java.net.SocketException: Broken pipe问题

莫莫水心 发布于 2013/09/03 21:20
阅读 21K+
收藏 1

@JFinal 你好,想跟你请教个问题:我系统采用jfinal+beetl的架构,环境是centos系统,总是不定时的报Broken pipe问题,详细报错如下

ClientAbortException:  java.net.SocketException: Connection reset
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:364)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:326)
at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:101)
at org.bee.tl.core.io.ByteWriter_Byte.flush(ByteWriter_Byte.java:91)
at org.bee.tl.core.CoreScriptRunner.runScript(CoreScriptRunner.java:226)
at org.bee.tl.core.BeeTemplate.getTextByByteWriter(BeeTemplate.java:201)
at org.bee.tl.ext.IncludeFileTemplateTag.makeOutput(IncludeFileTemplateTag.java:117)
at org.bee.tl.core.GeneralBeetlTag.getOutputAsByte(GeneralBeetlTag.java:74)
at org.bee.tl.core.CoreScriptRunner.parseTag(CoreScriptRunner.java:848)
at org.bee.tl.core.CoreScriptRunner.print(CoreScriptRunner.java:368)
at org.bee.tl.core.CoreScriptRunner.print(CoreScriptRunner.java:245)
at org.bee.tl.core.CoreScriptRunner.runScript(CoreScriptRunner.java:205)
at org.bee.tl.core.BeeTemplate.getTextByByteWriter(BeeTemplate.java:201)
at org.bee.tl.core.AbstractTemplate.getText(AbstractTemplate.java:80)
at org.bee.tl.ext.jfinal.BeetlRender.render(BeetlRender.java:102)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:92)
at com.wyf.handler.GetPostSameNameHandler.handle(GetPostSameNameHandler.java:16)
at com.wyf.handler.DruidStatViewHandler.handle(DruidStatViewHandler.java:58)
at com.wyf.handler.HtmlExtensionHandler.handle(HtmlExtensionHandler.java:16)
at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:47)
at com.wyf.handler.SessionHandler.handle(SessionHandler.java:19)
at com.wyf.handler.GetVistInfoHandler.handle(GetVistInfoHandler.java:44)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119)
at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:790)
at org.apache.coyote.Response.action(Response.java:173)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:359)
... 38 more
ClientAbortException:  java.net.SocketException: Broken pipe
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:364)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:326)
at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:101)
at org.bee.tl.core.io.ByteWriter_Byte.flush(ByteWriter_Byte.java:91)
at org.bee.tl.core.CoreScriptRunner.runScript(CoreScriptRunner.java:226)
at org.bee.tl.core.BeeTemplate.getTextByByteWriter(BeeTemplate.java:201)
at org.bee.tl.core.AbstractTemplate.getText(AbstractTemplate.java:80)
at org.bee.tl.ext.jfinal.BeetlRender.render(BeetlRender.java:102)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:92)
at com.wyf.handler.GetPostSameNameHandler.handle(GetPostSameNameHandler.java:16)
at com.wyf.handler.DruidStatViewHandler.handle(DruidStatViewHandler.java:58)
at com.wyf.handler.HtmlExtensionHandler.handle(HtmlExtensionHandler.java:16)
at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:47)
at com.wyf.handler.SessionHandler.handle(SessionHandler.java:19)
at com.wyf.handler.GetVistInfoHandler.handle(GetVistInfoHandler.java:44)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
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.realWriteBytes(InternalOutputBuffer.java:215)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119)
at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:790)
at org.apache.coyote.Response.action(Response.java:173)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:359)
... 31 more


不知道啥原因,根据网上改了jvm的参数还是报,请问有啥解决方法没?

加载中
0
莫莫水心
莫莫水心
@闲.大赋赋哥有啥看法没?
0
闲大赋
闲大赋

tomcat版本多少?

你自己在这个环境测试的时候,比如多次访问页面,发现有没有错误?如果没有错误且页面显示正常,那我觉得这应该是互联网出现这个错误很正常,比如用户访问某个页面,在页面未完全渲染结束前 离开导致的,beetl对于这种IO异常应该是可以忽略而无须抛到应用程序那儿,我可以重新发布一个忽略client io exception给你,你看看

0
莫莫水心
莫莫水心
@闲.大赋  tomcat 6.0的版本,jdk也是安装1.6的
0
leon_rock
leon_rock
我也碰到给问题 ,
leon_rock
leon_rock
@莫莫水心 没有啊
莫莫水心
莫莫水心
那你怎么解决的?
0
闲大赋
闲大赋
http://lya041.blog.51cto.com/337966/667284

这个文章可以看看,现在还未能确定哪儿的问题,我想,如果这个错误可以用文章中提到的类似方式解决,比如


NeverThrowClientRestWriter writer = new NeverThrowClientRestWriter (wirter);
tempalte.getText(writer)


NeverThrowClientRestWriter 实现方式类似BufferedWriter,功能仅仅阻止客户端连接异常



返回顶部
顶部