Apache CXF客户端“连接重置”长期要求 [英] Apache CXF client "connection reset" with long requests

查看:294
本文介绍了Apache CXF客户端“连接重置”长期要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SOAP Web服务。

I have a SOAP web service.

从SoapUI调用它时,无论消息内容的大小如何,请求都能正常运行。

When calling it from SoapUI the request works well, whatever the size of the message content.

如果我从Apache CXF客户端代码发出相同的请求,它可以处理小请求,但如果我的消息内容太长,我会得到连接重置,但有以下例外:

If I make the same requests from Apache CXF client code it works with small requests but I get a "connection reset" if my message content is too long, with the following exception:

Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1606)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1532)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1440)
... 37 more

有什么可能导致它或如何调试它的想法?

Any idea on what could cause it or how to debug it?

推荐答案

问题是由分块机制,当请求大小超过阈值且服务器端不支持时,CXF将启用它。

The problem is caused by the chunking mechanism which gets enabled by CXF when the request size is beyond a threshold and which is not supported on server side.

这个分块可以是以编程方式禁用但是CXF中存在一个错误,使得编程配置

This chunking can be disabled programmatically but there is a bug in CXF which makes that programmatic configuration is not taken into account in case of SSL connection.

解决方案是通过 spring配置文件

这篇关于Apache CXF客户端“连接重置”长期要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆