简体   繁体   中英

Error commiting response java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcher.write0(Native Method)

I encounter this error after a number of https requests. Anyone have any idea what could be the reason? It seens to be related to SSL. But previously it was working fine. I really don't understand what could have caused this issue

Error commiting responsejava.io.IOException: Broken pipe at sun.nio.ch.FileDispatcher.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104) at sun.nio.ch.IOUtil.write(IOUtil.java:75) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302) at com.sun.enterprise.server.ss.ASOutputStream.write(ASOutputStream.java:120) at com.sun.net.ssl.internal.ssl.OutputRecord.writeBuffer(OutputRecord.java:283) at com.sun.net.ssl.internal.ssl.OutputRecord.write(OutputRecord.java:272) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:666) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59) at org.apache.coyote.http11.InternalOutputBuffer.commit(InternalOutputBuffer.java:602) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.action(ProcessorTask.java:721) at org.apache.coyote.Response.action(Response.java:188) at org.apache.coyote.Response.sendH eaders(Response.java:380) at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:357) at org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:318) at org.apache.coyote.tomcat5.CoyoteResponse.finishResponse(CoyoteResponse.java:528) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:192) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:426) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281) at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83

I don't know about sun.nio.ch. but...

This is a standard annoying error you get sometimes in Java web apps. You get this error when requesting a URL and then either hitting stop in your browser or clicking away to another url. The app is complaining that it wasn't able to send you the complete response.

In my case this was happening when I generated an Excel or csv file on the server for local download (crash at HttpServletResponse getOutputStream().flush()) However it is related to the browser configuration, in my case Chrome 32 bits on Windows 7. Nothing on server side. For 3 days I've investigated in depth my web application, looking for the cause of the problem, checked many apache librairies etc. Then I tried to perform the same action from an another computer and finally from the same one with FireFox. No problem. Finally I discovered that the cause was Chrome's default Cache Size. I changed it with -disk-cache-size-2147483648 (at the end of the shortcut's target) and problem disappeared. I hope it can save time to someone.

A Java NIO Pipe is a one-way data connection between two threads. A Pipe has a source channel and a sink channel. You write data to the sink channel. This data can then be read from the source channel.

Now coming to the problem. Whenever sink channel is FULL (reads are NOT fast enough to leave some space in the buffer ), pipe is closed!! So any writes coming after this point will fail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM