title: Could not write message to OutputStream: java.net.SocketException: Broken pipe
body: <p>I'm facing some problems running some test to my application. My application is based on:
  - Java1.6
  - Weblogic 10.3.3
  - Oracle
  - Hibernate 3.5.3
  - Spring 2.5.6
  - Spring Integration 1.0.3</p>
  
  <p>The test itself is a set of queries by web services SOAP. After running this test, the application throws an exception in one of the query, this is the log:</p>
  
  <pre><code>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.ws.soap.axiom.AxiomSoapMessageException: Could not write message to OutputStream: java.net.SocketException: Broken pipe (errno:32); nested exception is javax.xml.stream.XMLStreamException: java.net.SocketException: Broken pipe (errno:32)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
  at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
  at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
  at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at com.jamonapi.http.JAMonServletFilter.doFilter(JAMonServletFilter.java:48)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  ...
  ...
  Caused by: org.springframework.ws.soap.axiom.AxiomSoapMessageException: Could not write message to OutputStream: java.net.SocketException: Broken pipe (errno:32); nested exception is javax.xml.stream.XMLStreamException: java.net.SocketException: Broken pipe (errno:32)
  at org.springframework.ws.soap.axiom.AxiomSoapMessage.writeTo(AxiomSoapMessage.java:261)
  at org.springframework.ws.transport.AbstractWebServiceConnection.send(AbstractWebServiceConnection.java:45)
  at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:97)
  at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
  at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
  ... 22 more
  Caused by: javax.xml.stream.XMLStreamException: java.net.SocketException: Broken pipe (errno:32)
  at org.apache.axiom.om.ds.OMDataSourceExtBase.serialize(OMDataSourceExtBase.java:91)
  at org.apache.axiom.om.ds.OMDataSourceExtBase.serialize(OMDataSourceExtBase.java:125)
  at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:738)
  at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:966)
  at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:995)
  at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:254)
  at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:242)
  at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:995)
  at org.apache.axiom.soap.impl.llom.SOAPMessageImpl.internalSerialize(SOAPMessageImpl.java:73)
  at org.apache.axiom.om.impl.llom.OMDocumentImpl.internalSerializeAndConsume(OMDocumentImpl.java:338)
  at org.apache.axiom.om.impl.llom.OMDocumentImpl.serializeAndConsume(OMDocumentImpl.java:382)
  at org.springframework.ws.soap.axiom.AxiomSoapMessage.writeTo(AxiomSoapMessage.java:255)
  ... 27 more
  Caused by: java.net.SocketException: Broken pipe (errno:32)
  at java.net.SocketOutputStream.socketWrite0(Native Method)
  at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:97)
  at java.net.SocketOutputStream.write(SocketOutputStream.java:141)
  at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:507)
  at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:486)
  at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
  at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:580)
  at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:306)
  at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:146)
  at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:138)
  at java.io.OutputStream.write(OutputStream.java:58)
  at org.springframework.ws.transport.TransportOutputStream.write(TransportOutputStream.java:56)
  at org.apache.axiom.om.ds.OMDataSourceExtBase.serialize(OMDataSourceExtBase.java:89)
  ... 38 more
  </code></pre>
  
  <p>If a run the query alone, using SoapUI, the response is the expected and fine.</p>
  
  <p>After the first time I run the test, it fails, but if I run a second time immediately, the test goes fine. It seems like the application misses the connection with the database, or is closed when the query arrives. Is it some kind of bug in any ot technologies I'm using?</p>
  
  <p>Best regards.</p>
  
  <p>Please ask for more information if you need.</p>