我有一个Spring-Boot应用程序,它在日志中不断显示此错误:
[xec-104]错误异常处理ErrorPage [errorCode = 0,location =/error] org.apache.catalina.connector.ClientAbortException:java.io.IOException:由org.apache.catalina.connector.OutputBuffer中的peer重置连接. doFlush(OutputBuffer.java:340)位于org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:303)的org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.j ava:109)at com. fastxml.jackson.core.json.UTF8JsonGenerator.flush(UTF8JsonGenerator.j ava:1048)位于org.springframework.http.converter.json的com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:95 3).在org.springframework.http.converter.AbstractGenericHttpMessageConverter中的AbstractJackson2HttpMessageConverte r.writeInternal(AbstractJackson2HttpMessageConverter.java:285).在org.springframework.web.servlet.mvc.method.annotation的org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConver terMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethod Processor.java:231)中编写e(AbstractGenericHttpMessageConverter.java:100) .httpEntityMethodProce ssor.handleReturnValue(HttpEntityMethodProcessor.java:203)位于org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandl的org.springframework.web.method.support.HandlerMethodReturnValueHandlerCompo site.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81) ergethod.invokeAndHandle(ServletInvocableHandlerMethod.java:132)位于org.springframework的org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandler Adapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827).web.servlet.mvc.method.annotation.RequestMappingHandler Adapter.handleInternal(RequestMappingHandlerAdapter.java:738)位于org.springframework的org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.han dle(AbstractHandlerMethodAdapter.java:85). web.servlet.DispatcherServlet.doDispatch(DispatcherServ let.java:963)atg.springframework.web.servlet.DispatcherServlet.doService(DispatcherServl et.java:897)org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkSe rvlet) .java:970)org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.jav a:861),位于org.springframework.web.servlet的javax.servlet.http.HttpServlet.service(HttpServlet.java:622) .FrameworkServlet.service(FrameworkServlet.j ava:846)在org的javax.servlet.http.HttpServlet.service(HttpServlet.java:729).位于org.apache.catalina.core.ApplicationDispatcher.invoke的org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC hain.java:165)中的apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio nFilterChain.java:230) ApplicationDispatcher .java:726)org.apache.atache.atache. .catalina.core.ApplicationDispatcher.forward(ApplicationDispatche r.java:311)org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:39 5)org.apache.catalina.core.StandardHostValve.status(StandardHostValve) .java:25 4)在org.apache的org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:17 7).catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav a:87)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java) :349)org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.jav a:66)at org.apache.coyote.AbstractProtocol $ ConnectionHandler .process(AbstractProtoc ol.java:802)org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.ja va:1410)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase) .java:49)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:112)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)at org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.j ava:61)at java.lang.Thread.run(Thread.java:745)引起:java.io.IOException:连接由sun.nio.ch.Idtil.ch上的sun.nio.ch.FileDispatcher.write(SocketDispatcher.java:47)中的sun.nio.ch.FileDispatcherImpl.write0(本地方法)重置连接.IOUtil.java:IOUtil.java: 93)在sun.nio.ch.IOUtil.write(IOUtil.java:65)的sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)org.apache.tomcat.util.net.NioChannel.write (NioChannel.java:134)org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.ja va:101)org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:157)在org.apache.tomcat.util.net.NioEndpoint $ NioSocketWrapper.doWrite(NioEndpoint .java:1221)org.apache.tomcat.util.net.SocketWrapperBase.flushBlocking(SocketWrapperBas e.java:451)org.apache.tomcat.util.net.SocketWrapperBase.flush(SocketWrapperBase.java:4 41)org.apache.coyote.http11.Http11OutputBuffer.flushBuffer( Http11OutputBuffer.java:514)atg.apache.coyote.http11.Http11OutputBuffer.flush(Http11OutputBuffer.java:2 43)org.apache中的org.apache.coyote.http11.Http11Processor.flush(Http11Processor.java:1495). coyote.AbstractProcessor.action(AbstractProcessor.java:284)org.apache.coyote.Response.action(Response.java:167)org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:336).. 41个常见帧省略Http11OutputBuffer.flushBuffer(Http11OutputBuffer.java:514)at org.apache.coyote.http11.Http11OutputBuffer.flush(Http11OutputBuffer.java:2 43)at org.apache.coyote.http11.Http11Processor.flush(Http11Processor.java:1495)at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:284)org.apache.coyote.Response.action(Response.java:167)org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java: 336)...省略了41个公共帧Http11OutputBuffer.flushBuffer(Http11OutputBuffer.java:514)at org.apache.coyote.http11.Http11OutputBuffer.flush(Http11OutputBuffer.java:2 43)at org.apache.coyote.http11.Http11Processor.flush(Http11Processor.java:1495)at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:284)org.apache.coyote.Response.action(Response.java:167)org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java: 336)...省略了41个公共帧OutputBuffer.doFlush(OutputBuffer.java:336)...省略了41个常用帧OutputBuffer.doFlush(OutputBuffer.java:336)...省略了41个常用帧
如您所见,堆栈跟踪不会从我的应用程序中显示任何内容.此异常仅发生在基础结构中.它是什么意思,我该如何重现?另外,我不明白为什么杰克逊在筹码追踪中.我的应用程序中没有任何JSON输出.
最后,我想了解我的应用程序是否存在问题.如果是这样,请修复它.如果没有,我不希望在我的日志中将其作为错误.
编辑:根据要求,这是pom.xml:
4.0.0
net.mixclouddownload
downloader
0.0.1-SNAPSHOT
org.springframework.boot
spring-boot-starter-parent
1.4.3.RELEASE
1.8
UTF-8
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-actuator
org.springframework.boot
spring-boot-devtools
true
org.springframework.retry
spring-retry
org.aspectj
aspectjweaver
net.bull.javamelody
javamelody-core
1.63.0
net.sf.jtidy
jtidy
r938
org.springframework.boot
spring-boot-starter-thymeleaf
org.webjars
bootstrap
4.0.0-alpha.6
org.webjars
font-awesome
4.7.0
commons-io
commons-io
2.5
com.ibm.icu
icu4j
58.2
org.webjars.bower
bootstrap-social
5.0.0
org.apache.httpcomponents
httpclient
org.twitter4j
twitter4j-core
4.0.6
org.facebook4j
facebook4j-core
2.4.8
com.google.guava
guava
21.0
org.springframework.boot
spring-boot-starter-cache
javax.cache
cache-api
ca.pjer
logback-awslogs-appender
0.1.0
org.apache.commons
commons-lang3
3.5
junit
junit
test
org.mockito
mockito-core
test
org.springframework.boot
spring-boot-starter-test
test
org.apache.maven.plugins
maven-compiler-plugin
${java-version}
-Xlint:all
true
true
org.springframework.boot
spring-boot-maven-plugin
true
org.apache.maven.plugins
maven-failsafe-plugin
integration-test
verify
这是因为客户端在Tomcat有机会写出响应之前关闭了连接.
此异常的主要实施者往往是"Internet Explorer",因为它处理资源连接(如下载JavaScript,CSS,图标等); 如果它决定它不再需要资源,它会在服务器有机会写出来之前关闭连接.当你在IE中使用Angularjs或其他SPA框架时,我也会看到更多.您将知道它是由IE引起的,因为请求资源路径是资源文件(如前所述).
第二个(或同样?)最常见的罪魁祸首可能是用户在有机会完成加载之前多次刷新页面,或者用户在页面加载完成之前导航.
第三个罪魁祸首,不太常见,但更令人愤怒的是,当你在自己的网络上呼叫服务时.您将在被调用的服务上看到"ClientAbortException",并在客户端服务上看到"SocketException:connection reset".原因通常是因为防火墙配置不当.我和我的系统管理员聊过,她说上次发生在我身上的原因是因为在高峰使用期间复制流量太高,所以防火墙无法及时返回数据包.解决方案是在其他重要应用程序的高峰使用期间限制来自特定来源(例如复制)的流量.我想你可以通过模拟大量使用和通过防火墙的流量来复制此错误.