title: SocketException in Java EE 6 application
body: <p>I get the following exception seemingly at random on several occations per day in production environment, and it's starting to bother me. I never get it while developing soi I have a hard time deciding the cause. Does anyone know what the cause might be? I've searched around on the exception without really finding anything useful.</p>
  
  <pre><code>2011-12-0808:18:51,311VARNING[javax.enterprise.resource.webcontainer.jsf.application](http-0.0.0.0-80-16)JSF1064:Unable to find or serve resource,jquery/ui/jquery-ui.js,from library,primefaces.
  2011-12-0808:18:51,311VARNING[javax.enterprise.resource.webcontainer.jsf.application](http-0.0.0.0-80-16):ClientAbortException:java.net.SocketException:Connection reset by peer:socket write error
      at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:402)[:6.1.0.Final]
      at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:449)[:6.1.0.Final]
      at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)[:6.1.0.Final]
      at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:425)[:6.1.0.Final]
      at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:414)[:6.1.0.Final]
      at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)[:6.1.0.Final]
      at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:296)[:1.6.0_27]
      at com.sun.faces.application.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:277)[:2.0.3-]
      at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:119)[:2.0.3-]
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:306)[:2.0.3-]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)[:6.1.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)[:6.1.0.Final]
      at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)[:]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)[:6.1.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)[:6.1.0.Final]
      at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)[:6.1.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)[:6.1.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)[:6.1.0.Final]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)[:6.1.0.Final]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)[:6.1.0.Final]
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)[:6.1.0.Final]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)[:6.1.0.Final]
      at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)[:1.1.0.Final]
      at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)[:1.1.0.Final]
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)[:6.1.0.Final]
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)[:6.1.0.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)[:6.1.0.Final]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)[:6.1.0.Final]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)[:6.1.0.Final]
      at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)[:6.1.0.Final]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)[:6.1.0.Final]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)[:6.1.0.Final]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)[:6.1.0.Final]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)[:6.1.0.Final]
      at java.lang.Thread.run(Thread.java:662)[:1.6.0_27]
  Caused by:java.net.SocketException:Connection reset by peer:socket write error
      at java.net.SocketOutputStream.socketWrite0(Native Method)[:1.6.0_27]
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)[:1.6.0_27]
      at java.net.SocketOutputStream.write(SocketOutputStream.java:136)[:1.6.0_27]
      at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:726)[:6.1.0.Final]
      at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:449)[:6.1.0.Final]
      at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)[:6.1.0.Final]
      at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:750)[:6.1.0.Final]
      at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:126)[:6.1.0.Final]
      at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:559)[:6.1.0.Final]
      at org.apache.coyote.Response.doWrite(Response.java:567)[:6.1.0.Final]
      at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:397)[:6.1.0.Final]
      ...34more
  </code></pre>