java - 为什么会出现这个错误?已建立的连接被主机中的软件中止

标签 java angularjs

堆栈:AngularJS v1.6.5、java 8、spring boot、tomcat。 经过大约 1 周的工作,应用程序没有响应此类错误。为什么会这样?

前端:

$http({
             url: 'find',
             method: "post",
             data: { 'month' : $scope.month,'year' : $scope.year, 'payTime' : $scope.payTime,'waitTime' : $scope.waitTime,'scanTime' : $scope.scanTime,'gbNumber' : $scope.hyper}
         })
         .then(function(response) {
 ..
       });
 }

后端:

@RequestMapping(path = "/find", method = RequestMethod.POST)
public ReportResponse find(@RequestBody RequestSearch params,
                           HttpServletResponse response) throws DataNotFoundException {
  ...

}

堆栈跟踪:

2018-04-02 09:37:44.738 ERROR 14912 --- [p-nio-80-exec-9] o.s.boot.web.support.ErrorPageFilter     : Cannot forward to error page for request [/excel/ExceReport.xls] as the response has already been committed. As a result, the response may have the wrong status code. If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false

org.apache.catalina.connector.ClientAbortException: java.io.IOException: An established connection was aborted by the software in your host machine
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:356) ~[catalina.jar:8.5.24]
        at org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:815) ~[catalina.jar:8.5.24]
        at org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:720) ~[catalina.jar:8.5.24]
        at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:391) ~[catalina.jar:8.5.24]
        at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:369) ~[catalina.jar:8.5.24]
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:96) ~[catalina.jar:8.5.24]
        at org.springframework.util.StreamUtils.copy(StreamUtils.java:138) ~[spring-core-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.http.converter.ResourceHttpMessageConverter.writeContent(ResourceHttpMessageConverter.java:110) ~[spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:102) ~[spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]
      ...

最佳答案

原因

This exception can mean that the connection to the client browser was aborted before the response is fully transferred. It is a harmless warning as it can be due to transient network problems or the user aborts/refreshes the page before it loaded.

其他原因的列表是:

The user closed the browser before the page loaded.

Their Internet connection failed during loading.

They went to another page before the page loaded.

The browser timed the connection out before the page loaded (would have to be a large page).

分辨率

This can be ignored, unless there are other issues that are currently occurring. For example, if the your application server is throwing a lot of these, it might be a sign of a performance problem.

关于java - 为什么会出现这个错误?已建立的连接被主机中的软件中止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50951435/

相关文章:

java - 具有切换功能的小部件

java - 我想写一个固定值的变量JSON

javascript - AngularJS GlobalCtrl vs $rootScope vs Service

angularjs - Angular : $interval undefined

java - Android:Android Studio 与 Eclipse

java - 无法在 eclipse (jundo) 中配置 Maven

java - 如何在其余服务中接收以八位字节流类型发送的图像?

javascript - 使用 ng-repeat 为输入字段创建动态行

javascript - Angularjs 在使用 http post 添加项目后获取数据,无需使用 mdDialog 刷新

javascript - 如何在加载指令时实现禁用