这次终于解决了 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: 断开的管道的更多相关文章

  1. redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: 断开的管道 (Write failed)

    昨晚,包发到测试环境中,出现redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: 断开的 ...

  2. Tomcat抛出异常:ClientAbortException: java.net.SocketException: Connection

    在做一个小网站的时候,写了一个通过servlet实现文件下载功能的页面.当我点击超级练级,弹出下载对话框,点击保存正常下载,不会出现任何问题,当我我点击取消,服务器端就出现如下提示: ClientAb ...

  3. ClientAbortException: java.net.SocketException: Software caused connection abort: socket write erro

    1.错误描述 ClientAbortException: java.net.SocketException: Software caused connection abort: socket writ ...

  4. java.io.IOException 断开的管道 解决方法 ClientAbortException: java.io.IOException: Broken pipe

    今天公司技术支持的童鞋报告一个客户的服务不工作了,紧急求助,于是远程登陆上服务器排查问题. 查看采集数据的tomcat日志,习惯性的先翻到日志的最后去查看有没有异常的打印,果然发现了好几种异常信息,但 ...

  5. 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- ...

  6. java.net.SocketException: Broken pipe 异常可能的原因

    org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Broken pipe at org.apa ...

  7. 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 ...

  8. ClientAbortException:java.io.IOException解决方案

    org.apache.catalina.connector Class ClientAbortException java.lang.Object java.lang.Throwable java.l ...

  9. 线上问题!----------org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe

    1.问题出现 昨晚项目在上线的时候因为推广的原因,新增的大量请求.在八点的时候. org.apache.catalina.connector.ClientAbortException: java.io ...

随机推荐

  1. 放一个Dynamicinputs corresponding to Dynamicknobs的Node源码

    static const char* const CLASS = "AddInputsSol"; static const char* const HELP = "Add ...

  2. 移动互联网终端的touch事件,touchstart, touchend, touchmove 很棒的文章

    转载请注明: 转载自WEB前端开发(www.css119.com)-关注常见的WEB前端开发问题.最新的WEB前端开发技术(webApp开发.移动网站开发).最好的WEB前端开发工具和最全的WEB前端 ...

  3. Linux LVM 简单操作

    查看当前磁盘分区情况fdisk -l 磁盘分区fdisk /dev/sdb# 可能用到的Type :# 8e Linux LVM# fd Linux raid auto 创建PVpvcreate /d ...

  4. 关于java多线程理解到集群分布式和网络设计的浅析

    对于JAVA多线程的应用非常广泛,现在的系统没有多线程几乎什么也做不了,很多时候我们在何种场合如何应用多线程成为一种首先需要选择的问题, 另外关于java多线程的知识也是非常的多,本文中先介绍和说明一 ...

  5. STL进阶--删除元素

    删除元素 从vector或deque删除元素 vector<int> vec = {1, 4, 1, 1, 1, 12, 18, 16}; // 删除所有的1 for (vector< ...

  6. console.log()换行和document.write()换行

    <!DOCTYPE html><html ><head><meta charset="utf-8"><title>ddd ...

  7. ping一个网段的cmd程序

    ping一个网段的cmd程序 今天发现只在cmd命令行工具中输入: FOR /L %i IN (1,1,254) DO ping -n 1 192.168.1.%i 即可.

  8. 改变端口的方法phpstudy

    document.ready 一个页面可以用无数次: window.onload 一个页面只能用一次,并且在最顶层: 用户交互:用户在网页上的一些行为: 服务交互:Ajax: 组件:(白话:按照我的规 ...

  9. maven release版本不自动更新的原因

    如果是release版本,首先从本地查找对应的版本,如果有,则使用本地,否则从远程服务器下载. 这也就是为什么我们有时想要去更新release版本的jar包,会发现无法更新,除非删除本地仓库中的版本. ...

  10. sqlite之多线程总结

    12.android 多线程数据库读写分析与优化 11.多线程操作Sqlite? ==== 11.android 多线程数据库读写分析与优化 最新需要给软件做数据库读写方面的优化,之前无论读写,都是用 ...