axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lakshmanan Venkatachalam (JIRA)" <>
Subject [jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
Date Sat, 30 Jun 2007 01:32:04 GMT


Lakshmanan Venkatachalam commented on AXIS2-2593:

We are also facing the similar problem in our production environment, having several CLOSE_WAIT
in application server.

We are using axis2-1.1, weblogic 8.1 sp6 and jdk 1.4.2_11. We are making only synchronous

I need a clarification, it seems like we have an issue with wherein after
the response is received, cleanup is not happening.

We tried to force garbage collection from the application server and got CLOSE_WAIT cleared.
Then i saw the cleanup() being  called in the finalize() method of

If I understood the problem clearly, since we have the cleanup() as public method in
can't we call this method from the client directly and do the proper cleanup after the response
has been received in the client.

I am sure you guys must have thought about it, kindly let me know if I am missing something


> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address
already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>                 Key: AXIS2-2593
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.1.1, nightly
>         Environment: Windows XP, Tomcat, Axis2 nightly build (also encountered in 1.1.1),
JiBX 1.1.3, Microsoft Windows XP [Version 5.1.2600], 126 GB free disk space, 1GB RAM.
>            Reporter: David Bueche
>            Assignee: Davanum Srinivas
>            Priority: Critical
>         Attachments: diff.txt,, JIRA_test.tar.gz
> I am performing the following:
> - Executing a tight loop calling a singel web service
> - Using the same Stub over and over
> - Creating the Stub with a custom ConfigurationContext (see below)
> - Sending cleanup() to Stub after each message sent (although problem existed even before
cleanup() was added)
> After approximately 4000 messages have been sent, an AxisFault is generated caused by
the following exception (see below for full stack trace):
> Address already in use: connect
> It appears that connections from the client to Axis on Tomcat sometimes (but not always)
remain in the TIME_WAIT state for several minutes.  There are 1200-1500 TIME_WAIT connections
open when the AxisFault is generated.
> If I step through the web service messages in a debugger, the problem does not appear
to occur, as the system eventually releases the connections after a minute or two.
> Also, if I insert a System.gc() in the client code each time it sends a message to the
web service (the commented out line of code below), the AxisFault does not occur.  I have
executed the loop over 60,000 times with the garbage collection included without generating
an AxisFault.  There were only 400-700 connections in the TIME_WAIT state at a given time,
but performance slowed down to a crawl.
> Here is the code I am using to create the Stub:
> 	HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
> 	connectionManagerParams.setTcpNoDelay(true);
> 	connectionManagerParams.setStaleCheckingEnabled(true);
> 	MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
> 	connectionManager.setParams(connectionManagerParams);
> 	HttpClient httpClient = new HttpClient(connectionManager);
> 	ConfigurationContext configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
> 	configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
> 	configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
> 	stub = new MyServiceStub(configurationContext, target);
> 	boolean success = true;
> 	while(success) {
> 		success = stub.performService(records);
> 		stub.cleanup();
> 		//  System.gc();
> 	}
> Here is the complete stack trace:
> 	Exception in thread "main" org.apache.axis2.AxisFault: Address already in use: connect
> 		at org.apache.axis2.AxisFault.makeFault(
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
> 		at org.apache.axis2.transport.http.HTTPSender.send(
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
> 		at org.apache.axis2.engine.AxisEngine.send(
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(
> 		at
> 		at
> 	Caused by: Address already in use: connect
> 		at Method)
> 		at
> 		at
> 		at
> 		at
> 		at
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 		at java.lang.reflect.Method.invoke(
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(
> 		at
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
> 		... 8 more

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message