ClientAbortException: java.net.SocketException: 断开的管道
这次终于解决了 ClientAbortException !
[ERROR] [- ::] net.jweb.actions.CommonDiskAction - 系统异常
ClientAbortException: java.net.SocketException: 断开的管道
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:)
at org.apache.catalina.connector.Response.flushBuffer(Response.java:)
at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:)
at net.jweb.actions.CommonDiskAction.download(CommonDiskAction.java:)
at sun.reflect.GeneratedMethodAccessor420.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at net.jweb.security.Authorization.intercept(Authorization.java:)
at net.jweb.mobile.security.Authorization.intercept(Authorization.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.TimerInterceptor.intercept(TimerInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.LoggingInterceptor.intercept(LoggingInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
Caused by: java.net.SocketException: 断开的管道
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:)
at java.net.SocketOutputStream.write(SocketOutputStream.java:)
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:)
at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:)
at org.apache.coyote.Response.action(Response.java:)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:)
... more
产生原因就是 断点下载引起的: 客户端下载到了一半, 用户点了 暂停, 服务器发现连接已经断开( 我认为是 httpResponse 已经断开引起的。), 于是。
但是,我通过SocketException 是无法catch到 异常的, 因为异常是 ClientAbortException 类型,但是, 我却无法导入 ClientAbortException, 奇了怪了!
只能在 catch (Exception e) { 内部进行捕捉。 观察到e.getMessage() 竟然是null, 而异常的toString 是 ” ClientAbortException: java.net.SocketException: 断开的管道 ”, 于是采取了这种方法进行捕捉了:
} catch (SocketException e) {
String message = e.getMessage();
if (message.startsWith("ClientAbortException")) {
return ;
} else {
e.printStackTrace();
}
} catch (Exception e) {
httpget.abort(); String message = e.toString();
if (message.startsWith("ClientAbortException")) {
return ;
} else {
// e.printStackTrace();
} // logger.error("DDN 加载文件失败!DDN出现异常: " + e.toString()+",storePath="+storePath+",p"+p+",pend"+pend+",len="+len+",realLen="+realLen);
return -;
}
捕捉成功, 也正确返回了 1, 但是 后台的错误日志还是DuangDuang的 涌出来。。。
于是, 又只能做 重定向 错误流 的工作了。
ClientAbortException: java.net.SocketException: 断开的管道的更多相关文章
- redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: 断开的管道 (Write failed)
昨晚,包发到测试环境中,出现redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: 断开的 ...
- Tomcat抛出异常:ClientAbortException: java.net.SocketException: Connection
在做一个小网站的时候,写了一个通过servlet实现文件下载功能的页面.当我点击超级练级,弹出下载对话框,点击保存正常下载,不会出现任何问题,当我我点击取消,服务器端就出现如下提示: ClientAb ...
- ClientAbortException: java.net.SocketException: Software caused connection abort: socket write erro
1.错误描述 ClientAbortException: java.net.SocketException: Software caused connection abort: socket writ ...
- java.io.IOException 断开的管道 解决方法 ClientAbortException: java.io.IOException: Broken pipe
今天公司技术支持的童鞋报告一个客户的服务不工作了,紧急求助,于是远程登陆上服务器排查问题. 查看采集数据的tomcat日志,习惯性的先翻到日志的最后去查看有没有异常的打印,果然发现了好几种异常信息,但 ...
- solr报错 ERROR SolrDispatchFilter null:ClientAbortException: java.net.SocketException: Broken pipe 原因是nginx截断了请求
[root@localhost nginx]# lltotal 36drwx------. 2 www root 4096 Aug 13 13:25 client_body_tempdrwxr-xr- ...
- java.net.SocketException: Broken pipe 异常可能的原因
org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Broken pipe at org.apa ...
- Caused by: java.net.SocketException: Software caused connection abort: socket write error
1.错误描述 [ERROR:]2015-05-06 10:54:18,967 [异常拦截] ClientAbortException: java.net.SocketException: Softwa ...
- ClientAbortException:java.io.IOException解决方案
org.apache.catalina.connector Class ClientAbortException java.lang.Object java.lang.Throwable java.l ...
- 线上问题!----------org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
1.问题出现 昨晚项目在上线的时候因为推广的原因,新增的大量请求.在八点的时候. org.apache.catalina.connector.ClientAbortException: java.io ...
随机推荐
- flask-appbuilder 快速入门
简介: Flask-AppBuilder是基于Flask实现的一个用于快速构建Web后台管理系统的简单的框架.主要用于解决构建Web后台管理系统时避免一些重复而繁琐的工作,提高项目完成时间,它可以和 ...
- phoenix psqlline输入命令无法删除问题解决技巧
一.引言: phoenix psqlline使用过程中,使用CRT客户端,命令输入后无法删除,想起曾经处理HBaseShell输入后无法删除的解决办法,尝试了一下,居然有效,还是分享给大家把. 二.操 ...
- spring 基本配置学习
1.bean的方式说明 作用: 用于配置对象让spring来创建的. 默认情况下它调用的是类中的无参构造函数.如果没有无参构造函数则不能创建成功. 属性: id:给对象在容器中提供一个唯一标识. ...
- Eclipse 安装阿里巴巴代码规范插件
好像是要求jdk1.8+ ,1.8以下的没试过 第一步: 选择 Install New Software 第二步: https://p3c.alibaba.com/plugin/eclipse/up ...
- 【剑指offer】二进制中1的个数
输入一个整数,输出该数二进制表示中1的个数.其中负数用补码表示. 思路:将原数字与1按位进行与操作. public class Solution { public int NumberOf1(int ...
- 廖雪峰Java5集合-4Set-1使用Set
集合 Set用于存储不重复的元素集合: boolean add(E e) boolean remove(Object o) boolean contains(Object o) int size() ...
- linux达人养成计划
一.命令基本格式: ls -1 详细列表 (ll) -h 人性化显示文件大小 -a 显示所有文件,包括隐藏文件 -d 查看目录属性 -i 显示iNode 二.文件处理命令 mkdir -p [目录名] ...
- Oracle 在SQL语句中如何获取系统当前时间并进行操作
select sysdate from dual;select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; select to_char(s ...
- 俞敏洪:我创业24年感悟的3条CEO守则
转自:http://www.gamelook.com.cn/2017/10/306603 创业24年,他的创业经历被拍成了电影.在一次小范围聚会时,他说现实远比剧本要精彩.“如果让我一切从头开始,我会 ...
- sas transpose 代码备忘
OPTIONS NOCENTER LS=MAX PS=MAX; LIBNAME S '.\report';/*PROC PRINT DATA=S.doquestionr(WHERE=(sid=1972 ...