对于Java EE应用程序,我不时会在日志中收到SocketException。造成这种情况的一个原因是浏览器突然被杀死。
我怎样才能发现这些错误?因为它们不会出现在我可以用try-catch包围的特定方法中。
Caused by: ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:346)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:306)
at org.apache.catalina.connector.Response.flushBuffer(Response.java:572)
at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:307)
at org.apache.openejb.server.httpd.ServletResponseAdapter.flushBuffer(ServletResponseAdapter.java:205)
at org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.close(AbstractHTTPDestination.java:726)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.AbstractHTTPDestination$BackChannelConduit.close(AbstractHTTPDestination.java:655)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 24 more
Caused by: java.net.SocketException: Connection reset by peer: socket write error
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:462)
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:174)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:341)
... 32 more
答案 0 :(得分:0)
这是内部tomcat日志记录。您需要更改tomcat的配置,甚至修改源代码。 Tomcat有大量的日志文档。