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)
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.
Thanks Hikumar
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.
}
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;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With