• Post Reply Bookmark Topic Watch Topic
  • New Topic

Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host

 
shashank beerla
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone please suggest how to resolve this exception. I implemented a code which writes huge data to the csv file. I don't know why the connection is getting out.



org.mortbay.jetty.EofException
org.mortbay.jetty.EofException
org.mortbay.jetty.HttpConnection$Output@f09f9a
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760)
at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:566)
at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:911)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
at java.io.BufferedWriter.flush(BufferedWriter.java:254)
at com.fedex.forecast.datamart.server.util.CSVFileDownloadServlet.writeCsv(CSVFileDownloadServlet.java:180)
at com.fedex.forecast.datamart.server.util.CSVFileDownloadServlet.doPost(CSVFileDownloadServlet.java:75)
at com.fedex.forecast.datamart.server.util.CSVFileDownloadServlet.doGet(CSVFileDownloadServlet.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
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:94)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
at org.mortbay.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:160)
at org.mortbay.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:207)
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:693)
... 28 more
 
Paul Clapham
Sheriff
Posts: 21882
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That just means that while you were writing data to be sent to the client, the client (confusingly referred to as "the remote host" in this error message) has disconnected. This is probably something normal, like the person running the browser becoming bored and closing the browser. So there's nothing to resolve. Is there some reason you are concerned about this, or did you just find it in the logs and decide it might be a problem?
 
shashank beerla
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am concerned because the CSV file which generates when I click download button on my front interface doesn't show any data in the file. I have no clue why is it nor writing any data. Thanks,
 
Paul Clapham
Sheriff
Posts: 21882
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps the client is timing out because it takes an excessively long time to produce the downloaded file?
 
shashank beerla
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any solutions to this then?
 
Paul Clapham
Sheriff
Posts: 21882
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that error message is a bit of a red herring. (Which means, it's likely to lead you in the wrong direction.) I would suggest that you start by testing with a small data set, so you can prove you have working code. Then try that working code on larger and larger data sets and see if problems arise at a certain point.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!