users@grizzly.java.net

Re: javax.ws.rs.InternalServerErrorException. Grizzly/Jersey problem?

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Tue, 15 Apr 2014 12:03:41 -0700

At the first glance it looks like a client closes the connection before
the response is completely written.

WBR,
Alexey.


On 15.04.14 11:09, Andrew Munn wrote:
> Just got this. Does it look like something I'm doing wrong? I haven't
> been able to reproduce it just yet.
>
> -Andrew
>
>
>
> Apr 15, 2014 12:52:04 PM
> org.glassfish.jersey.server.ServerRuntime$Responder writeResponse
> SEVERE: An I/O error has occurred while writing a response message entity
> to the container output stream.
> javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
> at
> org.glassfish.jersey.message.internal.AbstractCollectionJaxbProvider.writeTo(AbstractCollectionJaxbProvider.java:282)
> at
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:263)
> at
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
> at
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
> at
> org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:103)
> at
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
> at
> org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:88)
> at
> org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
> at
> org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1154)
> at
> org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:571)
> at
> org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:378)
> at
> org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:368)
> at
> org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:262)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
> at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
> at
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:320)
> at
> org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:236)
> at
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
> at
> org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:363)
> at
> org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:219)
> at
> org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
> at
> org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
> at java.lang.Thread.run(Thread.java:744)
> Caused by: javax.xml.bind.MarshalException
> - with linked exception:
> [java.io.IOException: An established connection was aborted by the
> software in your host machine]
> at
> com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:313)
> at
> com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:236)
> at
> javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95)
> at
> org.glassfish.jersey.message.internal.XmlCollectionJaxbProvider.writeList(XmlCollectionJaxbProvider.java:178)
> at
> org.glassfish.jersey.message.internal.AbstractCollectionJaxbProvider.writeTo(AbstractCollectionJaxbProvider.java:280)
> ... 25 more
> Caused by: java.io.IOException: An established connection was aborted by
> the software in your host machine
> at sun.nio.ch.SocketDispatcher.write0(Native Method)
> at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
> at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
> at sun.nio.ch.IOUtil.write(IOUtil.java:51)
> at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:466)
> at
> org.glassfish.grizzly.nio.transport.TCPNIOUtils.flushByteBuffer(TCPNIOUtils.java:149)
> at
> org.glassfish.grizzly.nio.transport.TCPNIOUtils.writeCompositeBuffer(TCPNIOUtils.java:87)
> at
> org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:112)
> at
> org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:91)
> at
> org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:261)
> at
> org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:170)
> at
> org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:70)
> at
> org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:126)
> at
> org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191)
> at
> org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:291)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:209)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:137)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:115)
> at
> org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
> at
> org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:848)
> at
> org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:817)
> at
> org.glassfish.grizzly.http.io.OutputBuffer.flushBuffer(OutputBuffer.java:1022)
> at
> org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:678)
> at
> org.glassfish.grizzly.http.server.NIOOutputStreamImpl.write(NIOOutputStreamImpl.java:83)
> at
> org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:229)
> at
> com.sun.xml.internal.bind.v2.runtime.output.UTF8XmlOutput.flushBuffer(UTF8XmlOutput.java:403)
> at
> com.sun.xml.internal.bind.v2.runtime.output.UTF8XmlOutput.endDocument(UTF8XmlOutput.java:127)
> at
> com.sun.xml.internal.bind.v2.runtime.XMLSerializer.endDocument(XMLSerializer.java:836)
> at
> com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.postwrite(MarshallerImpl.java:362)
> at
> com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:309)
> ... 29 more