org.eclipse.jetty.io.RuntimeIOException: org.eclipse.jetty.io.EofException: Stream closed

arturl43391132

17-08-2020

Hello Adobe Community,
We have a problem with Jetty:
org.eclipse.jetty.io.RuntimeIOException: org.eclipse.jetty.io.EofException: Stream closed at org.eclipse.jetty.server.ResponseWriter.isOpen(ResponseWriter.java:133) at org.eclipse.jetty.server.ResponseWriter.flush(ResponseWriter.java:146) at java.io.PrintWriter.flush(PrintWriter.java:320) ... Caused by: org.eclipse.jetty.io.EofException: Stream closed at org.eclipse.jetty.server.ResponseWriter.isOpen(ResponseWriter.java:136) at org.eclipse.jetty.server.ResponseWriter.write(ResponseWriter.java:180) at java.io.PrintWriter.write(PrintWriter.java:405) at org.apache.sling.engine.impl.log.RequestLoggerResponse$LoggerResponseWriter.write(RequestLoggerResponse.java:451) at org.apache.sling.engine.impl.SlingHttpServletResponseImpl$1.write(SlingHttpServletResponseImpl.java:333)
I need to inject a large script (~64k) in a static html file, and I am using a Servlet Filter for this purpose, but once I create the result, on the response write this exception is thrown. I tried to look at the Jetty configuration in OSGi but playing with the response buffer didn't help. Actually, I was able to make it work in local environment just randomly, after a series of deployments. The source is ok 100%, without any doubt, the problem seems the truncation at 64k of the response by Jetty. Is there anybody in this community that faced such or a similar issue? Any help or hint would be very welcome.
Thx in advance

Answers (1)

Answers (1)

PuzanovsP

MVP

17-08-2020

Hi Artur,

 

May I ask you to try and:

"increase Jetty servlet engine's response buffer size to avoid early auto-flushing. Response Buffer Size can be set on the Jetty OSGi configuration (http://host:port/system/console/configMgr/org.apache.felix.http). You could safely increase this as high as 200000." [1]

 

[https://helpx.adobe.com/experience-manager/kb/Response-is-committed-error-during-page-load-AEM.html]

 

Additionally, I would ask you to look at your code and verify that no where else in other parts of your code you don't close the stream before this filter.

 

Regards,

Peter