org.eclipse.jetty.io.EofException in AEM 6.3 | Community
Skip to main content
rubenf42159101
New Participant
August 2, 2018
Solved

org.eclipse.jetty.io.EofException in AEM 6.3

  • August 2, 2018
  • 12 replies
  • 13561 views

Hi,

I'm trying to call a servlet using GET to download an asset from DAM in AEM 6.3.2.0. Asset gets download with file size as zero and I get below exception in the log

org.apache.sling.engine.impl.helper.ClientAbortException: org.eclipse.jetty.io.EofException

at org.apache.sling.engine.impl.log.RequestLoggerResponse$LoggerResponseOutputStream.write(RequestLoggerResponse.java:401)

at com.sample.servlet.DownloadAssetServlet.doGet(DownloadAssetServlet.java:87)

at org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:270)

at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:346)

at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:378)

at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)

at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)

..........................................................................

..........................................................................

at org.eclipse.jetty.server.Server.handle(Server.java:499)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

at java.lang.Thread.run(Thread.java:748)

Caused by: org.eclipse.jetty.io.EofException: null

at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:192)

at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:408)

at org.eclipse.jetty.io.WriteFlusher.completeWrite(WriteFlusher.java:364)

at org.eclipse.jetty.io.SelectChannelEndPoint.onSelected(SelectChannelEndPoint.java:111)

at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:641)

at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:612)

at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:550)

at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)

... 3 common frames omitted

Caused by: java.io.IOException: Broken pipe

at sun.nio.ch.FileDispatcherImpl.write0(Native Method)

at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)

at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)

at sun.nio.ch.IOUtil.write(IOUtil.java:65)

at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)

at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:170)

... 10 common frames omitted

Is this an issue in AEM 6.3?

Regards,

Ruben Fernando

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi Ruben,

Your code is fine, works for me.

aem63app-repo/DownloadAssetsImage.java at master · arunpatidar02/aem63app-repo · GitHub

Problem is somewhere else, you should check the other endpoint.

12 replies

arunpatidar
New Participant
August 2, 2018

Hi,

The most common reason to have "broken pipe" exception is that one machine (of a pair communicating via socket) has shut down its end of the socket before communication was complete. About half of those were because the program communicating on that socket had terminated. If the program sending bytes sends them out and immediately shuts down the socket or terminates itself, it is possible for the socket to cease functioning before the bytes have been transmitted and read.

Try putting pauses anywhere you are shutting down the socket and before you allow the program to terminate to see if that helps.

FYI: "pipe" and "socket" are terms that get used interchangeably sometimes.

Arun Patidar
smacdonald2008
New Participant
August 2, 2018

Hey - can you please post your code example so the community can look at it. It will make it much easier for the community to help you with the code.