tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject java.net.SocketException when user disconnects from response stream
Date Fri, 04 Mar 2005 10:07:00 GMT
Hi,

I've seen similar posts from users before on this topic but do not believe I saw a concrete
answer. I was streaming a PDF to my browser yesterday when I decided to quickly move to another
page in the website and therefore stopping the PDF response stream. When I looked in the logs,
I found the following stack trace.

The com.lowagie.text.pdf has spotted that this was a Client Abort which it was, but I also
noted that it is wrapping up the real error that occured which was a java.net.SocketException:
Connection reset by peer: socket write. 
We have this java.net.SocketException: Connection reset by peer: socket write error in our
logs quite often on our production server and I am "guessing" that perhaps users are stopping
the response stream somehow, perhaps closing the browser or moving to another page mid-response?

In both that case, and in the case of aborting the PDF stream as below, I am not convinced
I need to care since it does not impair the server that a user did not bother to receive the
full response. 

Does anyone disagree or have an explanation why such scary stack traces should be output by
Tomcat each time a user does not complete receiving their response .. is it perhaps because
Tomcat is unable to differentiate between a user closing their browser and some other network
problem that I may well want to know about?

Thanks, Allistair.

ExceptionConverter: ClientAbortException:  java.net.SocketException: Connection reset by peer:
socket write error
	at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366)
	at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:403)
	at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:314)
	at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:293)
	at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:85)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
	at com.lowagie.text.pdf.OutputStreamCounter.flush(Unknown Source)
	at com.lowagie.text.DocWriter.close(Unknown Source)
	at com.lowagie.text.pdf.PdfWriter.close(Unknown Source)
	at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)
	at com.lowagie.text.Document.close(Unknown Source)
	at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:457)
	at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:282)
	at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:174)
	at net.sf.jasperreports.engine.JasperPrintManager.printReportToPdfStream(JasperPrintManager.java:145)
	at net.sf.jasperreports.engine.JasperRunManager.runReportToPdfStream(JasperRunManager.java:269)
	at com.qas.newmedia.intranet.pof.actions.mypos.PDFGenerateAction.doWork(PDFGenerateAction.java:155)
	at com.qas.newmedia.intranet.iq.actions.SecuredBaseAction.execute(SecuredBaseAction.java:188)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at com.qas.newmedia.common.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:65)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:305)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:383)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
	at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:595)


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message