Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jersey, An I/O error has occurred while writing a response message

Tags:

java

io

jersey

I use SpringBoot and Jersey into my project and I often tackle the following error :

[ERROR - ServerRuntime$Responder - 2018-02-13 13:16:45,983] An I/O error has occurred while writing a response message entity to the container output stream.
org.glassfish.jersey.server.internal.process.MappableException: org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
        at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:92)
        at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
        at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
        at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711)
        at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)
        at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

It results with a 503 status response to my client. Could you explain me why this error occured ?

Thanks

like image 277
Charly berthet Avatar asked Feb 13 '18 13:02

Charly berthet


1 Answers

This kind of error usually happens servlet is writing data back on the stream and connection closed from client side. It is like server in sending some data may be file, string, bytes etc.. but on client side like a browser has closed the connection, like you close the browser tab. It cased early End of file exception on the server.

like image 81
om.gurgaon Avatar answered Oct 18 '22 02:10

om.gurgaon