【问题标题】:Caused by: java.net.SocketException: Unexpected end of file from server引起:java.net.SocketException:来自服务器的文件意外结束
【发布时间】:2014-03-03 12:58:01
【问题描述】:

当我通过 SOAP UI 运行 WS 时,我间歇性地收到以下错误。有时它不起作用,然后它继续工作,然后有时它又不起作用。另一个问题是客户端提供的测试 Web 服务工作正常,没有问题,但是当我们切换到生产服务时,它会出现问题。谷歌搜索并做了一些更改(HttpConfig 超时,码头 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 添加即可。

【问题讨论】:

  • 您是否向生产系统发送了非常大的消息?看起来像是 ReceiveTimeout 问题。
  • 请求仅包含名称和 ID,所以一点也不大。有时反应很大。
  • 在使用 uat url 时也可以完美地使用相同的参数(超时等),即使是大型响应。
  • 您能确认传输层的传输没有中断吗?尝试连续ping服务器,看看传输过程中是否有中断(以请求超时的形式)
  • 我无法使用直接 ping,因为我通过代理访问它

标签: java web-services cxf apache-camel


【解决方案1】:

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

【讨论】:

  • 嗨!我遇到了同样的问题,请问您能澄清一下您的解决方案吗?
  • 解决方案是确保您不保持连接(默认)。将其设置为在每次请求/响应后关闭。
  • 将keep-alive设置为false,顺便说一下,可以通过在启动期间将网络属性-Dhttp.keepAlive=false设置为VM参数来完成,例如java -Dhttp.keepalive=false....
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-11
  • 1970-01-01
相关资源
最近更新 更多