users@jersey.java.net

[Jersey] Re: Problem Error

From: Ryan Stewart <rds6235_at_gmail.com>
Date: Fri, 6 May 2011 09:20:17 -0500

In the middle of writing out a response, your connection to the client is
reset--the client closed the connection, a network device is forcibly
closing the connection, etc... This causes a
javax.xml.bind.MarshalException since it fails in writing to the
OutputStream. Jersey wraps that in a WebApplicationException, which would
normally be returned as the response; however, part of your response has
already been flushed, and after flushing, the response can't be changed,
hence the message about not being able to use the response of the
WebApplicationException.

This is all just conjecture based on the stacktrace, of course.

On Thu, May 5, 2011 at 4:13 PM, RiScone <rich.schone_at_hsc.utah.edu> wrote:

> I am receiving the following error: Any suggestion on where to look to
> resolve it.
> SEVERE: The response of the WebApplicationException cannot be utilized as
> the response is already committed. Re-throwing to the HTTP container
> javax.ws.rs.WebApplicationException: javax.xml.bind.MarshalException
> - with linked exception:
> [ClientAbortException: java.net.SocketException: Connection reset by peer:
> socket write error]
> at
>
> com.sun.jersey.core.provider.jaxb.AbstractListElementProvider.writeTo(AbstractListElementProvider.java:183)
> at
>
> com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)
> at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1310)
> at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1223)
> at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1213)
> at
>
> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414)
> at
>
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
> at
>
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
> at
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: javax.xml.bind.MarshalException
> - with linked exception:
> [ClientAbortException: java.net.SocketException: Connection reset by peer:
> socket write error]
> at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:320)
> at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)
> at
>
> javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
> at
>
> com.sun.jersey.json.impl.JSONMarshallerImpl.marshal(JSONMarshallerImpl.java:74)
> at
>
> com.sun.jersey.core.impl.provider.entity.XMLListElementProvider.writeList(XMLListElementProvider.java:145)
> at
>
> com.sun.jersey.core.provider.jaxb.AbstractListElementProvider.writeTo(AbstractListElementProvider.java:181)
> ... 20 more
>
> --
> View this message in context:
> http://jersey.576304.n2.nabble.com/Problem-Error-tp6335692p6335692.html
> Sent from the Jersey mailing list archive at Nabble.com.
>