java 异常“javax.servlet.jsp.JspException: Broken pipe”表示什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2775534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 22:46:33  来源:igfitidea点击:

What does the exception "javax.servlet.jsp.JspException: Broken pipe" signify?

javajspstrutsexception

提问by Ruepen

I'm getting the following error:

我收到以下错误:

javax.servlet.jsp.JspException: Broken pipe

Now I have seen questions/answers with respects to the socket exception, but this error is coming from a different package. Any help is greatly appreciated.
BTW, I am seeing quite a lot of these errors in a struts web app Weblogic Node logs and I am thinking that it has to do with end users closing their web browser before the page reloads/executes the next step (database transaction which takes quite a bit of time to execute, anywhere from 30 seconds to 4 mins).

现在我已经看到了有关套接字异常的问题/答案,但是这个错误来自不同的包。任何帮助是极大的赞赏。
顺便说一句,我在 struts 网络应用程序 Weblogic 节点日志中看到了很多这些错误,我认为这与最终用户在页面重新加载/执行下一步之前关闭他们的网络浏览器有关(数据库事务需要相当需要一点时间来执行,从 30 秒到 4 分钟不等)。

采纳答案by BalusC

I am thinking that it has to do with end users closing their web browser before the page reloads/executes the next step

我认为这与最终用户在页面重新加载/执行下一步之前关闭他们的网络浏览器有关

You are entirely correct. This exception will be thrown when the client aborts the current request by navigating away, closing the tab/window, refreshing the request, etc whilethe request is still running. In other words, the client abruptly closed the connection and the server side can't write/flush any byte to it anymore. It has normally an IOExceptionas the root cause, usually in flavor of a servletcontainer specific subclass like ClientAbortExceptionin case of Tomcat and clones. If you investigate the entire stacktrace in the server logs, you'll find it somewhere at the bottom.

你是完全正确的。当客户端通过浏览掉,关闭标签/窗口,刷新请求等中止当前请求这将引发异常,同时请求仍在运行。换句话说,客户端突然关闭了连接,服务器端不能再向它写入/刷新任何字节。它通常有一个IOException作为根本原因,通常是 servletcontainer 特定子类的风格,如ClientAbortExceptionTomcat 和克隆的情况。如果您调查服务器日志中的整个堆栈跟踪,您会在底部的某处找到它。

回答by Kelly S. French

The HTTPRequest is handled by a chain of servlets which are connected to each other using pipes. When the browser abandons the connection and the socket gets closed, that is being caught by the servlet chaining managment layer. The servlet probably is indirectly catching the socket closed exception and is thowing it as the broken pipe. Look at any wrapped exception for more details.

HTTPRequest 由一系列 servlet 处理,这些 servlet 使用管道相互连接。当浏览器放弃连接并且套接字关闭时,servlet 链接管理层会捕获这种情况。servlet 可能间接捕获套接字关闭异常并将其视为损坏的管道。查看任何包装的异常以获取更多详细信息。

回答by Daniel

I am sure the underlying package uses pipes internally to transfer the result from a to b. Now B (the ServletOutputStream) closes, and the other end of the pipe notifies this by throwing this exception.

我确信底层包在内部使用管道将结果从 a 传输到 b。现在 B(ServletOutputStream)关闭,管道的另一端通过抛出这个异常来通知这一点。

回答by Sanjay Gupta

It happens when the user clicks stop, or logs off, or otherwise prematurely aborts the connection, We can ignore this exception.

当用户点击停止,或注销,或以其他方式过早中止连接时会发生这种情况,我们可以忽略此异常。