本文介绍了引起:java.net.SocketException:来自服务器的文件意外结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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]

只需将 SOAP UI 添加到生产端点即可正常工作.

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

推荐答案

我们终于发现服务器端设置了连接超时,因此我们的保持连接会在分配的时间后超时,从而导致间歇性错误.每次都将连接更改为关闭,现在一切正常.

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.

这篇关于引起:java.net.SocketException:来自服务器的文件意外结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 00:00