14

I am getting the below error quite intermittently when i run the WS through SOAP UI. Sometimes it does not work and then it keeps working and then again sometimes it does not work. One other issue is the test web service works fine provided by client with no issues but moment we switch to the production one it gives issues. Googled and did some changes (timeout on HttpConfig , jetty maxIdleTime) but still cant make it work :( Any ideas how i can narrow down what the issue is ?

org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]

Caused by: java.net.SocketException: SocketException invoking https://www.website:443/gateway/ServicePortV2: Unexpected end of file from server
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.7.0_25]



Caused by: java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:718)[:1.7.0_25]
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)[:1.7.0_25]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1322)[:1.7.0_25]
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)[:1.7.0_25]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)[:1.7.0_25]
    at org.apache.cxf.transport.http.HTTPConduit.processRetransmit(HTTPConduit.java:1004)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.http.HTTPConduit.access$400(HTTPConduit.java:148)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRetransmits(HTTPConduit.java:1504)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1438)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]

Just to add using SOAP UI with the production endpoint works fine.

Peter Keller
  • 7,526
  • 2
  • 26
  • 29
Samar
  • 443
  • 1
  • 5
  • 17
  • Did you send a very large message to the production system? It looks like a ReceiveTimeout issue. – Willem Jiang Mar 04 '14 at 07:04
  • The request consists of only name and id so not large at all. The response is large at times. – Samar Mar 04 '14 at 08:25
  • Also works perfectly with same params (timeout etc) when using uat url even for large responses. – Samar Mar 04 '14 at 08:26
  • Can you confirm there's no break in the transmission in the transport level? Try a continuous ping of the server to see if there are any breaks (in the form of a request timeout) during the transmission – kolossus Mar 04 '14 at 19:42
  • I am unable to use a direct ping since i am accessing it through a proxy – Samar Mar 04 '14 at 21:19
  • so server side says they see no errors/exceptions. Does that mean request is not reaching them at all ? Is it a client side issue then. – Samar Mar 07 '14 at 05:26
  • It is more like a network issue instead of CXF issue. – Willem Jiang Mar 10 '14 at 02:20
  • Possible duplicate of [Java simple code: java.net.SocketException: Unexpected end of file from server](http://stackoverflow.com/questions/19824339/java-simple-code-java-net-socketexception-unexpected-end-of-file-from-server) – dev Nov 28 '15 at 10:08

1 Answers1

12

We finally found out that the server side has a connection timeout set so our keep alive connections would timeout after the allocated time and hence the intermittent errors. Changed connection to close each time and all good now.

Samar
  • 443
  • 1
  • 5
  • 17
  • 1
    Hi! Im having the same issue, please, could you clarify about your solution? – Jose Nov 27 '14 at 15:52
  • Solution is to make sure you don't keep-alive(default) the connection. Set it to close after each request/response. – Samar Nov 29 '14 at 01:22
  • 2
    Setting keep-alive to false, by the way, can be done by setting the network property `-Dhttp.keepAlive=false` as VM parameter during startup, e.g. `java -Dhttp.keepalive=false...`. – user3792852 Aug 26 '16 at 07:31