org.apache.catalina.connector.ClientAbortException: java.io.IOException: 断开的管道

简介: org.apache.catalina.connector.ClientAbortException: java.io.IOException: 断开的管道

当把项目Nginx作负载均衡时,有些时间较长的请求,Tomcat就报如下错误:

org.apache.catalina.connector.ClientAbortException: java.io.IOException: 断开的管道 at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer. at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk. at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer. at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer. at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream. at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder. at sun.nio.cs.StreamEncoder.flush(StreamEncoder. at at org.springframework.util.StreamUtils.copy(StreamUtils. at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter. at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter. at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter. at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor. at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor. at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor. at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite. at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod. at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter. at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter. at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter. at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet. at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet. at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet. at at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet. at at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at org.jasig.cas.client.util.AssertionThreadLocalFilter.doFilter(AssertionThreadLocalFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at com.bfd.filter.CASFilter.doFilter(CASFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at com.bfd.filter.CrossDomainFilter.doFilter(CrossDomainFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve. at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve. at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter. at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor. at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol. at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint. at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint. at at at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread. at Caused by: java.io.IOException: 断开的管道 at sun.nio.ch.FileDispatcherImpl.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher. at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil. at sun.nio.ch.IOUtil.write(IOUtil. at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl. at org.apache.tomcat.util.net.NioChannel.write(NioChannel. at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector. at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool. at org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer. at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioOutputBuffer. at org.apache.coyote.http11.InternalNioOutputBuffer.access$000(InternalNioOutputBuffer. at org.apache.coyote.http11.InternalNioOutputBuffer$SocketOutputBuffer.doWrite(InternalNioOutputBuffer. at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter. at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer. at org.apache.coyote.Response.doWrite(Response. at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer. ... 73 mo

如上报错原因就是连接断开了。 具体错在哪里呐: 最后发现问题在Nginx,发现Nginx的连接超时时间设计的太短了,当服务器处理时间比较长时,等返回结果时,Nginx端已经超时断链了,Tomcat就报错了。解决方法就是把Nginx时间调大一点,就行。

相关文章
|
29天前
|
Shell
Flume【问题记录 01】【at org.apache.flume.node.Application.main(Application.java:xxx) 类问题整理+其他类型问题总结】【避坑指南】
【2月更文挑战第17天】Flume【问题记录 01】【at org.apache.flume.node.Application.main(Application.java:xxx) 类问题整理+其他类型问题总结】【避坑指南】
115 2
|
29天前
|
Dubbo Java 应用服务中间件
Serialized class org.apache.catalina.core.ApplicationPart must implement java.io.Serializable
Serialized class org.apache.catalina.core.ApplicationPart must implement java.io.Serializable
60 0
|
8天前
|
Java 应用服务中间件
记录报错:java.lang.NullPointerException org.apache.jsp.test_jsp._jspInit(test_jsp.java:23)
记录报错:java.lang.NullPointerException org.apache.jsp.test_jsp._jspInit(test_jsp.java:23)
|
29天前
|
分布式计算 Java 大数据
IO流【Java对象的序列化和反序列化、File类在IO中的作用、装饰器模式构建IO流体系、Apache commons-io工具包的使用】(四)-全面详解(学习总结---从入门到深化)
IO流【Java对象的序列化和反序列化、File类在IO中的作用、装饰器模式构建IO流体系、Apache commons-io工具包的使用】(四)-全面详解(学习总结---从入门到深化)
59 0
|
23天前
|
存储 缓存 监控
Java一分钟之-Apache Ignite:分布式内存计算平台
【5月更文挑战第21天】Apache Ignite是一款开源的分布式内存计算平台,涉及内存数据网格、流处理和计算服务。本文关注其常见问题,如数据丢失、分区不均、内存管理和网络延迟。为保证数据一致性,建议使用适当的數據模式和备份策略,实现数据持久化。优化内存配置和监控网络可提升性能与稳定性。提供的Java代码示例展示了如何创建分区缓存并设置备份。正确配置和管理Ignite是构建高可用、高性能应用的关键,持续监控集群状态至关重要。
43 0
|
23天前
|
缓存 监控 Java
Java一分钟之-Apache Geode:分布式内存数据平台
【5月更文挑战第21天】Apache Geode是低延迟的分布式内存数据平台,用于构建实时应用,提供缓存、数据库和消息传递功能。本文聚焦于Geode的常见问题,如数据一致性(数据同步延迟和分区冲突)和性能瓶颈(网络延迟和资源管理不当),并提出解决方案。确保数据一致性可通过选择合适的数据策略和利用`InterestPolicy`、`CacheListener`;提升性能则需优化网络和合理配置资源。通过示例代码展示了如何创建和操作Geode的Region。正确配置和调优Geode对于实现高可用、高性能应用至关重要。
46 1
|
29天前
|
数据采集 机器学习/深度学习 Java
数据猎手:使用Java和Apache HttpComponents库下载Facebook图像
本文介绍了如何使用Java和Apache HttpComponents库从Facebook获取图像数据。通过设置爬虫代理IP以避免限制,利用HttpClient发送请求,解析HTML找到图像链接,然后下载并保存图片。提供的Java代码示例展示了实现过程,包括创建代理配置、线程池,以及下载图片的逻辑。注意,实际应用需根据Facebook页面结构进行调整。
数据猎手:使用Java和Apache HttpComponents库下载Facebook图像
|
29天前
|
Java
[Java并发编程]浅谈管道
[Java并发编程]浅谈管道
|
29天前
|
Java API Apache
ZooKeeper【基础 03】Java 客户端 Apache Curator 基础 API 使用举例(含源代码)
【4月更文挑战第11天】ZooKeeper【基础 03】Java 客户端 Apache Curator 基础 API 使用举例(含源代码)
40 11
|
29天前
|
消息中间件 存储 Java
深度探索:使用Apache Kafka构建高效Java消息队列处理系统
【4月更文挑战第17天】本文介绍了在Java环境下使用Apache Kafka进行消息队列处理的方法。Kafka是一个分布式流处理平台,采用发布/订阅模型,支持高效的消息生产和消费。文章详细讲解了Kafka的核心概念,包括主题、生产者和消费者,以及消息的存储和消费流程。此外,还展示了Java代码示例,说明如何创建生产者和消费者。最后,讨论了在高并发场景下的优化策略,如分区、消息压缩和批处理。通过理解和应用这些策略,可以构建高性能的消息系统。

推荐镜像

更多