原因:java.net.SocketException:服务器的文件意外结束

原因:java.net.SocketException:服务器的文件意外结束,java,web-services,cxf,apache-camel,Java,Web Services,Cxf,Apache Camel,当我通过soapui运行WS时,会间歇性地出现以下错误。有时它不工作,然后它继续工作,然后又有时它不工作。另一个问题是,客户机提供的测试web服务运行良好,没有任何问题,但当我们切换到生产服务时,它会给出问题。谷歌搜索并做了一些更改(HttpConfig超时,jetty maxIdleTime),但仍然无法使其正常工作:(有没有办法缩小问题的范围 org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache

当我通过soapui运行WS时,会间歇性地出现以下错误。有时它不工作,然后它继续工作,然后又有时它不工作。另一个问题是,客户机提供的测试web服务运行良好,没有任何问题,但当我们切换到生产服务时,它会给出问题。谷歌搜索并做了一些更改(HttpConfig超时,jetty maxIdleTime),但仍然无法使其正常工作:(有没有办法缩小问题的范围

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]

只需在生产端点上添加使用SOAP UI即可。

我们最终发现服务器端设置了连接超时,因此我们的保持活动连接将在分配的时间后超时,因此会出现间歇性错误。将连接更改为每次关闭,现在一切正常。

您是否向e生产系统?看起来像是ReceiveTimeout问题。请求只包含名称和id,所以根本不大。响应有时很大。也可以与相同的参数完美配合(超时等)当使用uat url进行大型响应时。您能确认传输级别的传输没有中断吗?请尝试连续ping服务器以查看是否有中断(以请求超时的形式)在传输过程中,我无法使用直接ping,因为我是通过proxyHi访问它的!我也有同样的问题,请您澄清一下您的解决方案好吗?解决方案是确保您不保持活动状态(默认)连接。在每次请求/响应后将其设置为关闭。顺便说一句,将keep alive设置为false可以通过在启动期间将网络属性
-Dhttp.keepAlive=false
设置为VM参数来完成,例如
java-Dhttp.keepAlive=false…