0

I have a sample project hosted on the tomcat 5.5 server, that uses JDBC to connect to a MSSQL R2 database. But randomly and quite often I get a ClientAbortException and my application crashes. What can I do? Debugging does not help since I cannot reproduce the errors:

  • Play version : 1.2.3 and 1.2.4 (on both version the errors occur)
  • Machine: Windows Server 2003 and 2008

Stack trace ERROR ~

@698gd0b9n
Internal Server Error (500)

Oops: ClientAbortException
An unexpected error occured caused by exception ClientAbortException: null

play.exceptions.UnexpectedException: Unexpected Error
    at play.Invoker$Invocation.onException(Invoker.java:244)
    at play.Invoker$Invocation.run(Invoker.java:286)
    at play.server.ServletWrapper$ServletInvocation.run(ServletWrapper.java:548)
    at play.Invoker.invokeInThread(Invoker.java:68)
    at play.server.ServletWrapper.service(ServletWrapper.java:142)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)
Caused by: ClientAbortException:  java.net.SocketException: Connection reset by peer: socket write error
    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:370)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:352)
    at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:396)
    at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:385)
    at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
    at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:83)
    at play.server.ServletWrapper.copyResponse(ServletWrapper.java:493)
    at play.server.ServletWrapper$ServletInvocation.execute(ServletWrapper.java:558)
    at play.Invoker$Invocation.run(Invoker.java:278)
    ... 18 more
Caused by: java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:751)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:347)
    at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:774)
    at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118)
    at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:584)
    at org.apache.coyote.Response.doWrite(Response.java:560)
    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:365)
    ... 26 more
bluish
  • 26,356
  • 27
  • 122
  • 180
adis
  • 5,901
  • 7
  • 51
  • 71
  • are you able to handle other incoming requests after this exception thrown out? – Gelin Luo Feb 13 '12 at 11:34
  • the Application.index (render()) method does work, but everything else fails. My other API urls collects data from the database and they all fail, after this error. – adis Feb 13 '12 at 12:11
  • Can someone explain the root of the **ClientAbortException**? – adis Feb 17 '12 at 09:39
  • I can reproduce this behaviour by holding the F5 key for some time... – adis Feb 20 '12 at 09:52

2 Answers2

2

I had a similar problem, but using Play-1.2.3 / Tomcat 6 / H2 Database.
I never really understood the source of the problem but it was solved by modifying our deployment process and making sure Tomcat was completely stopped before replacing the war file.
I also had to remove all Tomcat temporary files before relaunching Tomcat the first time.

This must have something to do with Tomcat trying to hot-swap the war file and Play not closing its resources properly, but I stopped investigating after finding a valid workaround.
I found out that some exceptions are not handled in the framework, which led to error messages and logged exception having nothing to do with the actual problem.

This answer may not be in the stackoverflow standards (I'm not sure if it is the same problem and I just submit a workaround), but I felt this personal experience was related. Let me know if I should delete it, modify it or anything.

Louis Carrese
  • 791
  • 4
  • 7
0

For Play 1.1.1 / Tomcat 7.082 / No Database (It's feed with jersey 2 REST)

I deleted all temp files in Tomcat/temp and in Tomcat/work/Catalina/localhost.

This solved this issue for me.

Jordi M.
  • 69
  • 3