Class JerseyClientAbortLogFilter
- All Implemented Interfaces:
jakarta.servlet.ServletContextListener, EventListener
The symptom: org.glassfish.jersey.server.ServerRuntime$Responder logs
"Error while closing the output stream in order to commit response" at SEVERE whenever the
client socket goes away before Jersey finishes writing the response — typically because the
caller hit Ctrl-C, navigated away, or its HTTP client timed out. The root cause is always a
org.apache.catalina.connector.ClientAbortException wrapping a Broken pipe or
Connection reset IOException. There is nothing actionable the server can do —
the response has already been sent past the point of repair — and the noise drowns out real
errors during normal usage (browser preview probes, health checks, abandoned curl calls).
This filter installs a Filter on the Jersey Responder
logger that drops only records whose thrown cause chain ends in a broken-pipe / connection-reset
IOException. Everything else passes through; real Jersey response-writing errors still surface.
Registered in web.xml after JdbcDriverDeregistrationListener.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextDestroyed(jakarta.servlet.ServletContextEvent sce) voidcontextInitialized(jakarta.servlet.ServletContextEvent sce)
-
Constructor Details
-
JerseyClientAbortLogFilter
public JerseyClientAbortLogFilter()
-
-
Method Details
-
contextInitialized
public void contextInitialized(jakarta.servlet.ServletContextEvent sce) - Specified by:
contextInitializedin interfacejakarta.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(jakarta.servlet.ServletContextEvent sce) - Specified by:
contextDestroyedin interfacejakarta.servlet.ServletContextListener
-