开发者社区> 问答> 正文

linux服务器上 java.net.SocketException: Brok?报错

@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的参数还是报,请问有啥解决方法没?

展开
收起
爱吃鱼的程序员 2020-06-22 17:01:55 617 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
    @闲.大赋大 赋哥有啥看法没?

    tomcat版本多少?

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

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

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


    NeverThrowClientRestWriterwriter=newNeverThrowClientRestWriter(wirter);tempalte.getText(writer)


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



    2020-06-22 17:02:11
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Alibaba Cloud Linux 3 发布 立即下载
ECS系统指南之Linux系统诊断 立即下载
ECS运维指南 之 Linux系统诊断 立即下载