org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。

org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。
	at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:299)
	at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:262)
	at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:118)
	at com.opensymphony.module.sitemesh.filter.RoutableServletOutputStream.flush(RoutableServletOutputStream.java:122)
	at java.io.BufferedOutputStream.flush(Unknown Source)
	at com.thinkgem.jeesite.modules.bigdata.selectMap.web.SelectMapController.getIdPicFile(SelectMapController.java:338)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.thinkgem.jeesite.common.filter.XSSFilter.doFilter(XSSFilter.java:25)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)

  

原因分析:

在tomcat中出现这个错误是由于客户端在发送请求后,还没等服务器响应就断开了连接,有可能是因为网络原因,突然网断了,但是如果错误频繁出现的话,可能就是服务端的问题了。

tomcat中配置了一个连接超时时间connectionTimeout,如果在这个时间之后客户端还未得到服务器端的响应的话,就会主动断开连接,这样就会出现上述异常了,tomcat中默认的连接超时时间是20秒,我们一般最好设置为60秒,从而避免后台程序处理时间长导致连接断开。

解决方法:

可以通过设置tomcat下conf文件夹的server.xml文件,对请求连接数和请求超时时间进行设置。

  1. <Connector port="8080" protocol="HTTP/1.1"

  2.  

    connectionTimeout="20000"

  3.  

    redirectPort="8443" acceptCount="500" maxThreads="400" />

connectionTimeout以毫秒为单位,默认设置为20秒。通过修改该参数,可以修改tomcat的请求超时时间;

关于修改最大并发请求连接数,需要修改maxThreads和acceptCount两个参数,

其中,maxThreads的介绍如下:

The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200. If an executor is associated with this connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool.

而acceptCount的介绍为:

The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.

所以两者的默认值分别是200和100,要调整Tomcat的默认最大连接数,可以增加这两个属性的值,并且使acceptCount大于等于maxThreads

原文地址:https://www.cnblogs.com/isme-zjh/p/11506380.html

时间: 2024-12-08 12:57:09

org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。的相关文章

Caused by: java.io.IOException: 您的主机中的软件中止了一个已建立的连接。

异常详情 2017-07-16 10:55:26,218 ERROR [500.jsp] - java.io.IOException: 你的主机中的软件中止了一个已建立的连接. org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接. at org.apache.catalina.connector.OutputBuffer.realWriteBytes(Output

Caused by: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。

org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接. at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:321) at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:284) at o

ClientAbortException: java.io.IOException: 您的主机中的软件中止了一个已建立的连接。,进不了Debug,访问不到方法

开发项目的时候运行报错,Debug进不去方法,猜想是js中ajax的url 路径的问题,后来找公司的斌哥解决了问题,感谢! 异常: 解决过程: 清理缓存,修改js代码,通过浏览器的F12查看,发现修改的代码并没有变动,得出结论,引入不正确. 出错原因: HTML中对应的 JS文件没有正确引入,这是一个不应该犯的错... 解决方法: 正确引入对应的js. 原文地址:https://www.cnblogs.com/weiqang/p/11429045.html

java.io.IOException: 您的主机中的软件中止了一个已建立的连接。

1.错误描述 [2015-06-15 19:13:48 - ddmlib] 您的主机中的软件中止了一个已建立的连接. java.io.IOException: 您的主机中的软件中止了一个已建立的连接. at sun.nio.ch.SocketDispatcher.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51) at sun.nio.ch.IOUtil.writeFromNat

错误号org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe

在说这个错误之前,我先介绍下背景,我们项目用的是SpringBoot框架,集成Hprose+spring+mybatis,Hprose是什么,可以参考我上篇对Hprose的一个简单介绍.当前项目业务是抓取一个网站近5年的足球篮球的赔率数据.所以这是个按照日期进行的一个大循环.介于Hprose特性,Hprose服务端的处理时间会特别长,这是个重点. 在项目上线抓取数据时,linux环境下,我们的程序出现了这样一个错误,如下: 2016-06-16 12:47:52.190 WARN 10150 -

Spring boot org.apache.catalina.connector.ClientAbortException 错误

1 org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接. 2 at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:393) 3 at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java

【IE下载文件——后台报ClientAbortException:java.io.IOException错误】

一.场景 页面上提供下载Excel文件的功能,用于下载报表中的数据. 分别在chrome,IE中进行测试.在chrome中正常,在IE中后台报错. 二.错误信息 org.apache.catalina.connector.ClientAbortException: java.io.IOException    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:407)    at org.

ClientAbortException:java.io.IOException解决方案

org.apache.catalina.connector Class ClientAbortException java.lang.Object java.lang.Throwable java.lang.Exception java.io.IOException org.apache.catalina.connector.ClientAbortException All Implemented Interfaces: java.io.Serializable ERROR [http-8080

hive执行query语句时提示错误:org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.io.IOException:

hive> select product_id, track_time from trackinfo limit 5; Total MapReduce jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.io.IOEx