Getting intermittent java.io.IOException: UT010029: Stream is closed in JBoss EAP 7

Solution Unverified - Updated -

Issue

The following exception happens when a browser closes connection before the response is fully sent.

2018-01-08 09:54:57,665 ERROR [io.undertow.request] (http-worker task-33) UT005023: Exception handling request to /example/endpoint: org.jboss.resteasy.spi.UnhandledException: RESTEASY003770: Response is committed, can't handle exception
        at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:174) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:478) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:422) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]
        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.3.31.Final-redhat-1.jar:1.3.31.Final-redhat-1]
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) [undertow-servlet-1.3.31.Final-redhat-1.jar:1.3.31.Final-redhat-1]
         .. .. ..
        at org.wildfly.mod_cluster.undertow.metric.RunningRequestsHttpHandler.handleRequest(RunningRequestsHttpHandler.java:69)
        .. ..
Caused by: java.io.IOException: UT010029: Stream is closed
        at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper$DeferredOutputStream.write(HttpServletResponseWrapper.java:46) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.util.CommitHeaderOutputStream.write(CommitHeaderOutputStream.java:71) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.util.DelegatingOutputStream.write(DelegatingOutputStream.java:48) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at com.fasterxml.jackson.core.json.UTF8JsonGenerator._flushBuffer(UTF8JsonGenerator.java:1848) [jackson-core-2.5.4.redhat-1.jar:2.5.4.redhat-1]
        at com.fasterxml.jackson.core.json.UTF8JsonGenerator.flush(UTF8JsonGenerator.java:1041) [jackson-core-2.5.4.redhat-1.jar:2.5.4.redhat-1]
        at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:854) [jackson-databind-2.5.4.redhat-2.jar:2.5.4.redhat-2]
        at org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider.writeTo(ResteasyJackson2Provider.java:207) [resteasy-jackson2-provider-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.writeTo(AbstractWriterInterceptorContext.java:136) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.core.interception.ServerWriterInterceptorContext.writeTo(ServerWriterInterceptorContext.java:62) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:124) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.security.doseta.DigitalSigningInterceptor.aroundWriteTo(DigitalSigningInterceptor.java:145) [resteasy-crypto-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:129) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]
        at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:103) [resteasy-jaxrs-3.0.19.SP4-redhat-1.jar:3.0.19.SP4-redhat-1]

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content