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

apache.org | 2 months ago
  1. 0

    "java.io.IOException: Broken pipe" occur.

    Apache Bugzilla | 2 years ago | mougenko
    org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
  2. 0

    When I call Action, Broken pipe Exception occur. ・If don't use interceptor, Exception does not occur. ・If action result type is not stream, Exception does not occur. ・If read HttpResponse, Exception does not occur. ・If OS is Windows, Exception does not occur. ・If use Tomcat BIO protocol, Exception does not occur. {code:title=StackTrace|borderStyle=solid} org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:389) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:426) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:338) at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:291) at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:151) at org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:305) at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275) at org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) at com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:233) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275) Caused by: java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:89) at sun.nio.ch.IOUtil.write(IOUtil.java:60) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450) at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:127) at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101) at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:173) at org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:139) at org.apache.coyote.http11.InternalNioOutputBuffer.flushBuffer(InternalNioOutputBuffer.java:244) at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioOutputBuffer.java:189) at org.apache.coyote.http11.InternalNioOutputBuffer.access$000(InternalNioOutputBuffer.java:41) at org.apache.coyote.http11.InternalNioOutputBuffer$SocketOutputBuffer.doWrite(InternalNioOutputBuffer.java:320) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:116) at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:257) at org.apache.coyote.Response.doWrite(Response.java:492) at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:384) ... 164 more {code} {code:title=TestAction.java|borderStyle=solid} package sample.action; import java.io.ByteArrayInputStream; import java.io.InputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.InterceptorRef; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import com.opensymphony.xwork2.ActionSupport; @ParentPackage(value = "default") @InterceptorRef("first") public class TestAction extends ActionSupport { public InputStream inputStream; private static final Log log = LogFactory.getLog(TestAction.class); @Action(value = "test", results = { @Result(name = "error", type = "stream", location = "inputStream", params = {"contentType", "text/xml; charset=UTF-8" }), @Result(name = "success", type = "stream", location = "inputStream", params = {"contentType", "text/xml; charset=UTF-8" }) }) public String execute() throws Exception { try { log.info("Start"); inputStream = new ByteArrayInputStream("<result>test</result>".getBytes()); log.info("End"); return "success"; } catch (Exception e) { log.error(e.getMessage()); return "error"; } } } {code} {code:title=FirstInterceptor.java|borderStyle=solid} package sample.interceptor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.AbstractInterceptor; public class FirstInterceptor extends AbstractInterceptor { private static final Log log = LogFactory.getLog(FirstInterceptor.class); @Override public void init() { super.init(); } @Override public String intercept(ActionInvocation invocation) throws Exception { log.info("Start"); String result = ""; try { result = invocation.invoke(); } catch (Exception e) { log.fatal(e.getMessage(), e); return "error"; } log.info("End"); return result; } } {code} {code:title=ClientMain.java|borderStyle=solid} package sample.client; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; public class ClientMain { public static void main(String[] args) { try { for(int i = 0 ; i < 10 ; i++) { sendHttpRequest("http://<Host>/<context>/test"); } System.out.println("finish"); } catch(Exception e) { e.printStackTrace(); } } private static void sendHttpRequest(final String url) throws IOException { HttpPost httpPost = null; try { httpPost = new HttpPost(url); DefaultHttpClient httpclient = new DefaultHttpClient(); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("client_type", "")); httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8")); HttpResponse response = httpclient.execute(httpPost); if (response.getStatusLine().toString().indexOf(" 200 ") == -1) { // do something } } finally { if (httpPost != null) { httpPost.abort(); } } } } {code}

    Apache's JIRA Issue Tracker | 2 years ago | mougenko
    org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
  3. 0

    Bug 56853 – "java.io.IOException: Broken pipe" occur.

    apache.org | 2 months ago
    org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [jira] [Closed] (WW-4386) "java.io.IOException: Broken pipe" occurred

    apache.org | 1 year ago
    org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
  6. 0

    [WW-4386] "java.io.IOException: Broken pipe" occurred - ASF JIRA

    apache.org | 11 months ago
    org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe

  1. fima 26 times, last 2 months ago
  2. aldrinleal 1 times, last 4 months ago
  3. treanz 2 times, last 5 months ago
  4. William Hartzell-Baird 1 times, last 5 months ago
  5. Justin 298 times, last 7 months ago
21 more registered users
73 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.IOException

    Broken pipe

    at sun.nio.ch.FileDispatcherImpl.write0()
  2. Java RT
    SocketChannelImpl.write
    1. sun.nio.ch.FileDispatcherImpl.write0(Native Method)
    2. sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
    3. sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:89)
    4. sun.nio.ch.IOUtil.write(IOUtil.java:60)
    5. sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
    5 frames
  3. Grizzly HTTP
    Response.doWrite
    1. org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:127)
    2. org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101)
    3. org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:173)
    4. org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:139)
    5. org.apache.coyote.http11.InternalNioOutputBuffer.flushBuffer(InternalNioOutputBuffer.java:244)
    6. org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioOutputBuffer.java:189)
    7. org.apache.coyote.http11.InternalNioOutputBuffer.access$000(InternalNioOutputBuffer.java:41)
    8. org.apache.coyote.http11.InternalNioOutputBuffer$SocketOutputBuffer.doWrite(InternalNioOutputBuffer.java:320)
    9. org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:116)
    10. org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:257)
    11. org.apache.coyote.Response.doWrite(Response.java:492)
    11 frames
  4. Glassfish Core
    OutputBuffer.realWriteBytes
    1. org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:384)
    2. org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:389)
    2 frames
  5. Tomcat Util
    ByteChunk.flushBuffer
    1. org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:426)
    1 frame
  6. Glassfish Core
    CoyoteOutputStream.close
    1. org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:338)
    2. org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:291)
    3. org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:151)
    3 frames
  7. Struts2
    StrutsResultSupport.execute
    1. org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:305)
    2. org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
    2 frames
  8. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
    2. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
    2 frames
  9. Struts2
    DeprecationInterceptor.intercept
    1. org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
    1 frame
  10. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    1 frame
  11. Struts2
    DebuggingInterceptor.intercept
    1. org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
    1 frame
  12. XWork
    ValidationInterceptor.doIntercept
    1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    2. com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
    3. com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    4. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    5. com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
    5 frames
  13. Struts2
    AnnotationValidationInterceptor.doIntercept
    1. org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    1 frame
  14. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    2. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    3. com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
    4. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    5. com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
    6. com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    7. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    8. com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
    9. com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    10. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    11. com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
    12. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    12 frames
  15. Struts2
    MultiselectInterceptor.intercept
    1. org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
    1 frame
  16. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    1 frame
  17. Struts2
    CheckboxInterceptor.intercept
    1. org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
    1 frame
  18. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    1 frame
  19. Struts2
    FileUploadInterceptor.intercept
    1. org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
    1 frame
  20. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    2. com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
    3. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    4. com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
    5. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    6. com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
    7. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    8. com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
    9. com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    10. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    11. com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
    12. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    12 frames
  21. Struts2
    ServletConfigInterceptor.intercept
    1. org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    1 frame
  22. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    2. com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
    3. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    4. com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
    5. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    5 frames
  23. Struts2
    StrutsActionProxy.execute
    1. org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
    1 frame
  24. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:233)
    2. com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
    3. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
    3 frames