使用 IE8 浏览器部署在 jboss 的应用程序中的 ClientAbortException [英] ClientAbortException at application deployed at jboss with IE8 browser
问题描述
我在 Jboss 部署的应用程序出现以下异常,浏览器是 IE8
I am having following exception for application deployed at Jboss, Browser is IE8
2012-03-19 09:17:12,014 WARN [org.apache.catalina.core.ContainerBase.jboss.web]. [localhost]] Exception Processing ErrorPage[errorCode=404, location=/internalError.jsp]
ClientAbortException: java.net.SocketException: Broken pipe
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:327)
似乎浏览器在服务器写入 internalError.jsp 之前关闭了套接字.请建议如何解决它,或者至少我如何隐藏这个异常.
It seems that browser closed the socket before server writes internalError.jsp to it. Please suggest how to solve it , or atleast how I can hide this exception.
谢谢海库玛
推荐答案
你无法解决.当您的服务器仍在处理 HTTP 请求/响应时,您无法控制客户端是否按下 Esc,或匆忙单击不同的链接,或关闭浏览器,或使其机器崩溃等.
You cannot solve it. You cannot control whether the client will press Esc, or hastily click a different link, or close the browser, or have its machine crashed, etcetera, while your server is still handling the HTTP request/response.
您可以通过全局过滤器(映射在 /*
上)隐藏"它,它会执行以下操作:
You can "hide" it by a global filter (mapped on /*
) which does something like this:
try {
chain.doFilter(request, response);
}
catch (ClientAbortException e) {
// Ignore.
}
然而,这会在您的代码中带来 servletcontainer 特定的依赖项.有问题的过滤器会在不使用 Tomcat 特定的 ClientAbortException
的不同品牌的 servletcontainer 上导致 NoClassDefFoundError
.您可能想要检查类的简单名称.利用它是 IOException
的子类的优势:
This however brings a servletcontainer-specfic dependency in your code. The filter in question would result in NoClassDefFoundError
on a servletcontainer of a different make which doesn't use Tomcat specific ClientAbortException
. You might want to check the class simple name instead. Make use of the advantage that it's a subclass of IOException
:
try {
chain.doFilter(request, response);
}
catch (IOException e) {
if (!e.getClass().getSimpleName().equals("ClientAbortException")) {
throw e;
}
}
这篇关于使用 IE8 浏览器部署在 jboss 的应用程序中的 ClientAbortException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!