org.apache.axis2.AxisFault: Software caused connection abort: recv failed

Environment

JDK 1.5
Axis2 1.6.2
Eclipse 3.7.1

Situation

After generate WebService Client with Axis2, I tried to run the program; however, an error occurred “org.apache.axis2.AxisFault: Software caused connection abort: recv failed…”

logs
[httpclient.wire.header]-[DEBUG] >> “Transfer-Encoding: chunked[\r][\n]”
[httpclient.wire.header]-[DEBUG] >> “[\r][\n]”
[httpclient.wire.content]-[DEBUG] >> “3a8[\r][\n]”

Solution

1. Check if the network connection is OK.

2. Check HTTP chunking support. By default chunking is enabled in Axis2.xml for versions 1.1 and higher.

This time the problem is from HTTP chunking support. I think the server does not support it, so I need to disable the chunking function.

A. Deployment Time: axis2.xml

remove Transfer-Encoding parameter

<parameter name="Transfer-Encoding">chunked</parameter>

B. Runtime:

stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);

Others

Set timeout (20 min) :

stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(20 * 60 * 1000);

Set HTTP version :

stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION,org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10);

Reference:

http://axis.apache.org/axis2/java/core/docs/http-transport.html

http://wso2.com/library/209/

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s