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

Avatar

Avatar
Validate 10
Level 3
arturl43391132
Level 3

Likes

18 likes

Total Posts

68 posts

Correct reply

10 solutions
Top badges earned
Validate 10
Validate 1
Ignite 1
Give Back
Boost 5
View profile

Avatar
Validate 10
Level 3
arturl43391132
Level 3

Likes

18 likes

Total Posts

68 posts

Correct reply

10 solutions
Top badges earned
Validate 10
Validate 1
Ignite 1
Give Back
Boost 5
View profile
arturl43391132
Level 3

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
ChitraMadan
MVP

Likes

272 likes

Total Posts

165 posts

Correct reply

67 solutions
Top badges earned
Boost 250
Establish
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 250
MVP
ChitraMadan
MVP

Likes

272 likes

Total Posts

165 posts

Correct reply

67 solutions
Top badges earned
Boost 250
Establish
Ignite 1
Give Back 5
Give Back 3
View profile
ChitraMadan
MVP

17-08-2020

Answers (1)

Answers (1)

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
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