You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "David Bueche (JIRA)" <ji...@apache.org> on 2007/04/25 21:57:15 UTC

[jira] Created: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
-------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-2593
                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
             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
            Priority: Critical


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):

	java.net.BindException: 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, 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(AxisFault.java:377)
		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
		at com.ws.client.MyClient.main(MyClient.java:88)
	Caused by: java.net.BindException: Address already in use: connect
		at java.net.PlainSocketImpl.socketConnect(Native Method)
		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
		at java.net.Socket.connect(Socket.java:519)
		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
		at java.lang.reflect.Method.invoke(Method.java:585)
		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496367 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

David,

you are using a nightly build of 1.2, don't you? And what about the configuration context you use to initialize the ServiceClient, does it look like the one used here [1]? If so, please reopen the JIRA


Michele


[1] http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/async/AsyncService2Test.java

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495805 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

Michele or Dims,

Could one or you please post the code here for correctly utilizing the (including per-message cleanups, if any, and final cleanups)?

Thanks,
-David

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494946 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

Michele,

You need to pass in the URI ("http://ncl.ac.uk/qosp") correctly in the qname parameter for getFirstChildWithName method. Otherwise the latest axiom code cannot find the element. We are made it stricter now.

thanks,
dims

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495784 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

It's here:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/async/AsyncService2Test.java

you will need a nightly build of trunk.

-- dims

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495001 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

Dims,

1- Why do you need to set the timeout in options as setTimeOutInMilliSeconds? Isn't it enough to set SO_TIMEOUT and CONNECTION_TIMEOUT?
2 - The REUSE_HTTP_CLIENT option is already set in the configuration context. Why do you need to set it into the options as well? The ServiceClient is created using the custom conf. context, so there should be no problems, otherwise it does not make any sense to set specific options in two places (that is in the conf. context and in the ServiceClient options)
3 - The AUTO_RELEASE_CONNECTION options is new (I mean introduced in 1.2), isn't it? And what does the releaseConnection do?, ideally we want to reuse the same connection as much as possible (that's the idea behind keep alive connections)
4 - I didn't know about the thread pool trick. BTW, instead of using an axis2 thread pool, why don't we use the thread pool of java.util.concurrent (or backport-utils), which is much more flexible (i.e. it allows to limit the working queue size)

Thanks,
Michele

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494944 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

Michele,
there's a typo in build.xml

		<copy todir="${tmp.dir}/ntest/services"
		      file="${build.dir}/test/services/ServiceSupport.class"
		/>

Should be

		<copy todir="${tmp.dir}/test/services"
		      file="${build.dir}/test/services/ServiceSupport.class"
		/>

Basically drop the extra 'n' in the todir attribute. Causes a nasty CNFE.

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509282 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

Lakshmanan,

could you please try to download a more recent version of Axis2?


Michele

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496413 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

Michele,

We are using JiBX, invoking the service from the stub created by WSDL2Java.  I updated my code as follows, but am seeing a similar BindException:

16:21:50 WARN  Attempt number 1 of 10 to reestalish connection listener org.apache.axis2.transport.http.server.DefaultConnectionListener@f1fad1 due to failure 
java.net.BindException: Address already in use: JVM_Bind
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
	at java.net.ServerSocket.bind(ServerSocket.java:319)
	at java.net.ServerSocket.<init>(ServerSocket.java:185)
	at java.net.ServerSocket.<init>(ServerSocket.java:97)
	at org.apache.axis2.transport.http.server.DefaultConnectionListener.run(DefaultConnectionListener.java:82)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)

==============================================

I am also getting timeout AxisFaults on the client side:

org.apache.axis2.AxisFault: Time out while waiting for the server to send the response.

==============================================

Finally, I am seeing the following logged message on the server side:

2007-05-16 16:21:51,435 INFO  org.apache.axis2.util.Utils - Unable to parse request URL [http://<my JiBX XML namespace is displayed here>][/axis2/services]

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495047 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

Michele,

Please wait for an hour and then pick up the build. one of my commits failed yesterday night.

thanks,
dims

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496414 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

Also, here is the code used to invoke the service, mostly incorporated from the test case, but using JiBX stub generated from WSDL2Java and with comments identifying other divergences from the test case code:

	private void sendRecords(List<MyRecord> records)
			throws RemoteException, SubscriptionException, IOException {

		logger.debug("Publishing to consumer at: " + this.consumerUrl
				+ "; clientId = " + this.clientId + "; sending records: "
				+ records);

		MyRecord[] recordArray = new MyRecord[records.size()];
		records.toArray(recordArray);

		this.verifyStub();

		boolean success = this.stub.performService(recordArray);
		
		if (!success) {
			throw new SubscriptionException(
					"stub.performService(recordArray) Failed");
		}
	}

	// note that only one thread will ever have control at a time, thus no need
	// for synchronize
	private void verifyStub() throws AxisFault {

		if (this.stub == null) {
			ConfigurationContext context = getConfigurationContext();

			this.stub = new MyRecordConsumerStub(context,
					this.consumerUrl);
			// this.stub._getServiceClient().setCachingOperationContext(true); // previously, but no longer used

			Options options = this.stub._getServiceClient().getOptions(); // Options retrieved from stub instead of created new
			// endpoint is already set, so no need to reset it in the options below:
			// EndpointReference targetEPR = new EndpointReference(this.consumerUrl);
			// options.setTo(targetEPR);
			
			options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
			
			// this was resulting in WS-Addressing module AxisFault before fixing addressing module issue
			options.setUseSeparateListener(true);
			
			// this is replaced by an explicit assignment for now
			// options.setAction(operationName.getLocalPart());
			// don't think I need this -- breaks with or without -- options.setAction("performService");

			options.setTimeOutInMilliSeconds(TIMEOUT);
			options.setProperty(HTTPConstants.CHUNKED, Boolean.TRUE);
			options.setProperty(HTTPConstants.SO_TIMEOUT, TIMEOUT);
			options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, TIMEOUT);
			
			// this results in no repeat calls working
			options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
			
			// this results in reading from a closed stream
			options.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Boolean.TRUE);
		}
	}

	// Since this method initializes static variables, it must be synchronized
	private synchronized ConfigurationContext getConfigurationContext()
			throws AxisFault {

		if (configurationContext == null) {

			MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
			HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
			connectionManagerParams.setDefaultMaxConnectionsPerHost(1);
			connectionManagerParams.setTcpNoDelay(true);
			connectionManagerParams.setStaleCheckingEnabled(true);
			connectionManagerParams.setLinger(0); // not previously used
			connectionManager.setParams(connectionManagerParams);

			HttpClient httpClient = new HttpClient(connectionManager);

			configurationContext = createClientConfigurationContext();
			
			// configurationContext.setThreadPool(new ThreadPool(1, 3));
			configurationContext.setThreadPool(new ThreadPool(10000, 10000)); // not previously used
			
			configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);

			configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
		}

		return configurationContext;
	}

	public static ConfigurationContext createClientConfigurationContext()
			throws AxisFault {
		File file = getAddressingMARFile();
		TestCase.assertTrue(file.exists());

		ConfigurationContext configContext = ConfigurationContextFactory
				.createConfigurationContextFromFileSystem(
						// "target/test-resources/integrationRepo",
						// "target/test-resources/integrationRepo/conf/axis2.xml");
						"C:\\axis2-SNAPSHOT\\repository",
						"C:\\axis2-SNAPSHOT\\conf\\axis2.xml");
		AxisModule axisModule = DeploymentEngine.buildModule(file,
				configContext.getAxisConfiguration());
		configContext.getAxisConfiguration().addModule(axisModule);
		return configContext;
	}

	static class AddressingFilter implements FilenameFilter {
		public boolean accept(File dir, String name) {
			return name.startsWith("addressing") && name.endsWith(".mar");
		}
	}

	private static File getAddressingMARFile() {
		File dir = new File("C://axis2-SNAPSHOT//repository//modules");
		File[] files = dir.listFiles(new AddressingFilter());
		TestCase.assertTrue(files.length == 1);
		File file = files[0];
		TestCase.assertTrue(file.exists());
		return file;
	}



> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493791 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

Ok then try this tactic. Can you get hold of the OperationContext for
each invocation? Typically you can use
myServiceContext.getLastOperationContext() to get the last
OperationContext. You will have to start caching them though by
calling myServiceClient.setCachingOperationContext(true) or you can
create the OperationContext by calling
myServiceContext.createOperationContext as well. Either way after the
invocation is done you can call the following snippet to cleanup the
HttpMethod.

myOperationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
_messageContext.getTransportOut().getSender().cleanup(_messageContext);

thanks,
- Hide quoted text -
dims

On 5/4/07, Michele Mazzucco <Mi...@ncl.ac.uk> wrote:
> Dims,
>
> what do you mean by "calling the complete method"?. In this scenario I'm
> using simple ServiceClient(s) sharing the same conf. context and
> attached to custom callbacks (I'm reusing the same ServiceClients for
> thousands of asynchronous requests).
> For my knowledge (see the link below) the cleanup (on the ServiceClient)
> should be called only at the end which, as I said, is after receiving
> thousands of responses.
> Are you then suggesting me to share an OperationClient for all my
> requests and to free resources as soon as I receive the response?
>
> Thanks,
> Michele

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495022 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

Michele,

1 and 2 are bugs which need fixing. 
3 is new, i added it yesterday. yes, releaseConnection gives the control back to the pool from where the next person who needs a connection can pick it up from. Yes of course it uses keep alive. 
4 please take a look at org.apache.axis2.util.threadpool.ThreadPool. we do use the back-port stuff inside it. Yes, you can write your own threadpool in a jiffy and plug it in.

thanks,
dims

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496227 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

David,

you should cleanup only at the end. According to this (old) post [1] if the ServiceClient is initialized with a custom conf. context the call sender.cleanup() is not enough. You have to call this as well:
configurationContext.getListenerManager().stop();

Dims, if this is still true (I've found no documentation about it) then the test [2] is wrong since it does not stop the listener.


Michele


[1] http://www.nabble.com/-Axis2--ServiceClient-question-tf2496516.html#a6959251
[2] http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/async/AsyncService2Test.java

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495051 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

Dims,

just a comment. From the cleanup source code it looks to me that the connection is not released to the pool by default (that is one has to set the AUTO_RELEASE_CONNECTION property). Is there any reason for this? I think the opposite would be much better, i.e. by default the connection is returned to the pool.

Michele

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494329 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

Yes, I guess the reason is that when HTTP 1.1 is used (the default) HttpClient uses persistent connections (keep alive).

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495782 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

Dims & Michele,

You sent various comments to each other regarding the
correct mode of setting up a
MultiThreadedConnectionManager, specifically
referencing an integration file to which I don't have
access
(integration\test\org\apache\axis2\async\AsyncService2Test.java).

Could you post a copy of the correct means of using
Axis2 in a high volume environment to avoid the
TIME_WAIT issue?

Thanks,
-David



https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
integration\test\org\apache\axis2\async\AsyncService2Test.java
-------------------------------------------------------------------------------------------------------------
connectionManagerParams.setStaleCheckingEnabled(true);
connectionManager.setParams(connectionManagerParams);
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
org.apache.axis2.AxisFault.makeFault(AxisFault.java:377)
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)



       
____________________________________________________________________________________Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php


> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas resolved AXIS2-2593.
-------------------------------------

    Resolution: Fixed

Added a AUTO_RELEASE_CONNECTION flag (see svn revision 537188). Please see integration\test\org\apache\axis2\async\AsyncService2Test.java on how to set up the MultiThreadedConnectionManager.

thanks,
dims

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491969 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

David,

since you're running on Windows maybe this could help you https://issues.apache.org/jira/browse/AXIS2-2441.



> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495249 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

Dims,

I think at least when the REUSE_HTTP_CLIENT is used the behavior specified by AUTO_RELEASE_CONNECTION should be the default, it does not matter whether AUTO_RELEASE_CONNECTION is set or not

Michele

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494297 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

Michele & Davanum,

I was tracing the following thread after I had sent a web service message:

    MessageContext msgContext = this.stub._getServiceClient().getLastOperationContext().
        getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    msgContext.getTransportOut().getSender().cleanup(msgContext);

Down in the bowels of Jakarta Commons HttpClient, I notice that ultimately this thread goes to PostMethod(HttpMethodBase).shouldCloseConnection(HttpConnection).  The rest of the stack is:

        PostMethod(HttpMethodBase).responseBodyConsumed() line: 2264	
        HttpMethodBase$1.responseConsumed() line: 1747	
        AutoCloseInputStream.notifyWatcher() line: 180	
        AutoCloseInputStream.close() line: 140	
        PostMethod(HttpMethodBase).releaseConnection() line: 1078	
        CommonsHTTPTransportSender.cleanup(MessageContext) line: 79	

However, apparently if you are running HTTP 1.1 (which apparently we are, since the thread takes that route), the shouldCloseConnection method evaluates the following:

        return this.effectiveVersion.lessEquals(HttpVersion.HTTP_1_0);

which returns false to responseBodyConsumed(), telling it NOT to close the connection.  Thus, my client connections stay open in the TIME_WAIT state for the full TcpTimedWaitDelay duration.

Is there a reason why HTTP 1.1 web service connections should not be closed?  (i.e., if I hack something here to force the connections closed, will I break something else?).  Also, I noticed the protected method HttpMethodBase.getConnectionCloseForced() would trigger the closing of connections no longer in use.  Since this method is protected, what is the preferred means of setting this value to true?

Thanks,
-David

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Lakshmanan Venkatachalam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509231 ] 

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 call.

I need a clarification, it seems like we have an issue with ServiceClient.java 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 ServiceClient.java

If I understood the problem clearly, since we have the cleanup() as public method in ServiceClient.java 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 basically.

thanks
Lakshmanan




> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Assigned: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas reassigned AXIS2-2593:
---------------------------------------

    Assignee: Davanum Srinivas

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>         Assigned To: Davanum Srinivas
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas resolved AXIS2-2593.
-------------------------------------

    Resolution: Fixed

Folks,

Original problem reported was fixed and the fix is in nightly. If the nightly does not work for you, then please open new bug with *your* testcase. and link this bug to your new bug. The comments have gotten so out of hand that i have no idea whose scenario has what problem and what version they are using etc...Sorry for the trouble of making you open a new test case.

thanks,
dims

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496340 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

Michele,

I was running your test case to verify the fix and got the following Axis Fault: "org.apache.axis2.AxisFault: Transport error: 400 Error: Bad Request" in MultipleCallback.onError(), as well as the following stack trace 11 times during the call of sender.sendReceiveNonBlocking(request, callback) in Sender.run():

org.apache.axis2.transport.http.server.DefaultConnectionListenerFailureHandler.failed(DefaultConnectionListenerFailureHandler.java:97) WARN  [HttpListener-8080-1] - Attempt number 1 of 10 to reestalish connection listener org.apache.axis2.transport.http.server.DefaultConnectionListener@c9f997 due to failure 
java.net.BindException: Address already in use: JVM_Bind
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
	at java.net.ServerSocket.bind(ServerSocket.java:319)
	at java.net.ServerSocket.<init>(ServerSocket.java:185)
	at java.net.ServerSocket.<init>(ServerSocket.java:97)
	at org.apache.axis2.transport.http.server.DefaultConnectionListener.run(DefaultConnectionListener.java:82)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
	at java.lang.Thread.run(Thread.java:595)

Is this caused by the fix, or am I missing something in my configuration of the test?

-David

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas updated AXIS2-2593:
------------------------------------

    Attachment: JIRA-935_2593.zip

Latest test driver and services (after applying the diff on the original files from michele)

thanks,
dims

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495048 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

http://svn.apache.org/viewvc?view=rev&revision=537188 has the fix.

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas updated AXIS2-2593:
------------------------------------

    Attachment: diff.txt

Diff of modifications to the test case to get it working. Changes made include

1. In build.xml, Fix ntest -> test to get aar building correctly
2. In ServiceSupport.java, Fix QName (by specifying uri correctly) being passed as a parameter to getFirstChildWithName so that it does not fail with latest axion.
3. In StressTest.java, Illustrate how to set the maximum connections per host in commons http client (setDefaultMaxConnectionsPerHost)
4. In Sender.java
    - options.setTimeOutInMilliSeconds overrides other settings, so make sure that is set properly
    - set CHUNKED to true. May not be needed. You can try it out with and without chunking enabled.
    - REUSE_HTTP_CLIENT needs to be set in options to true. Otherwise it is not getting picked up
    - Added a AUTO_RELEASE_CONNECTION flag which basically ensures releaseConnection is called on say the PostMethod
    - Default ThreadPool just keeps creating threads till jvm runs out of threads if too many requests are queued and the # of connections is very small per host. So set thread pool explicitly to say 10 threads max. Internally the thread pool manages the # of threads such that we don't run out of threads (basically it will wait for an existing thread to finish its work and then reuse it instead of just blindly creating new threads everytime).

With this set of changes, i can see that the # of connections is being throttled properly.

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493790 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

[Posting my email comments here]

Michele,

Are you calling the complete method in OperationClient? that calls the
cleanup method in the TransportSender. I believe we are doing that
automatically in generated stubs as well where we generate the
following call.

_messageContext.getTransportOut().getSender().cleanup(_messageContext);

that calls the releaseConnection on the HttpMethod.

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Gerry Holly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510068 ] 

Gerry Holly commented on AXIS2-2593:
------------------------------------

Hello,

It seems this AUTO_RELEASE_CONNECTION solution only covers non-blocking operations.  What about blocking operations?

In a blocking scenario, when "handleResponse" is invoked in HTTPSender, it stores a reference to the InputStream in the message context so it can be later processed by the application.  Your fix renders this InputStream unreadable before the OutInAxisOperationClient gets a chance to process the SOAP message (through TransportUtils).  

This is the exception I get after implementing your HTTPConstants.java and HTTPSender.java (not using the nightly build):

Caused by: org.apache.axis2.AxisFault: Attempted read on closed stream.
    at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:51)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:130)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:77)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:356)
    at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
    ... 7 more
Caused by: java.io.IOException: Attempted read on closed stream.
    at org.apache.commons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:165)
    at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:106)
    at java.io.FilterInputStream.read(Unknown Source)
    at java.io.PushbackInputStream.read(Unknown Source)
    at org.apache.axis2.builder.BuilderUtil.getReader(BuilderUtil.java:191)
    at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:41)
    ... 11 more
    
Gerry

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494298 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

Sorry, I meant setConnectionCloseForced(boolean).
-David

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495023 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

Cool. So I need the last nightly build to try it out, don't I?

Michele

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492221 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

David,

it should be ok. To my knowledge you should call cleanup() only when you're done, which means that if you use the same client to send 1 million messages the cleanup is called only after receiving 1 million responses (I'm assuming an request/response scenario).

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Reopened: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Bueche reopened AXIS2-2593:
---------------------------------


The fix needs to work when the service is invoked by a JiBX stub.

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "David Bueche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492088 ] 

David Bueche commented on AXIS2-2593:
-------------------------------------

When my client sends messages to the web service, the OS starts assigning port numbers to the client sequentially.  By default, Windows XP only assigns port numbers up to 5000.

With netstat, my client ports show up almost all in a TIME_WAIT state, while the reply connections (from port 8080 to one of the client ports) seem to be released almost immediately.  However, the connections from the client ports to port 8080 (the web service) stay in a TIME_WAIT state for a couple of minutes.

The site at http://publib.boulder.ibm.com/infocenter/cmgmt/v8r3m0/index.jsp?topic=/com.ibm.eclient.doc/trs40019.htm correctly diagnosed part of this issue as an OS issue.  Namely, Windows XP defaults to TcpTimedWaitDelay = 120 and MaxUserPort = 5000 (or thereabouts).

These values can be overridden in the Windows registry by adding the following new DWORD values (the values do not exist by default):

    HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip /Parameters/
            TcpTimedWaitDelay = 30
            MaxUserPort = 65534

When I added these new values, my test ran successfully.  I have successfully sent over 2.5 million messages without a crash.

While this is a workaround for the OS limitations, it does not explain why the connections are not reused, even though I was using a custom ConfigurationContext with setTcpNoDelay(true), setStaleCheckingEnabled(true), MultiThreadedHttpConnectionManager, REUSE_HTTP_CLIENT, and CACHED_HTTP_CLIENT.

Was my custom ConfigurationContext correct, or is more needed to reuse the client side connections?  I tried this with and without a stub.cleanup().  Is something more needed to reuse the client/Stub connection to Axis running on Tomcat?

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Michele Mazzucco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492714 ] 

Michele Mazzucco commented on AXIS2-2593:
-----------------------------------------

According to [1] HttpClient uses persistent connections (i.e. multiple http requests use the same socket) by default, then it should not be possible to have > 1000 open connections (the tuning parameters on windows are just a workaround, as David correctly pointed out).

[2] explains that there's a 1:1 ratio between HttpConnection(s) and open sockets, so I guess the problem is that when a ServiceClient is reused every few send operations a new connection is created. A quick look to the code does not reveal any problem: the CommonsHTTPTransportSender class simply creates a new HttpSender in writeMessageWithCommons(), but then the client is correctly reused, if available (see AbstractHTTPSender.getHttpClient()).
Instead previous posts like [3] seems to indicate that even the HttpClient is reused, every few requests a new connection is opened.




[1] http://jakarta.apache.org/commons/httpclient/performance.html#Connection_persistence
[2] http://www.innovation.ch/java/HTTPClient/advanced_info.html#conn_details
[3] http://www.nabble.com/Apache-Axis-2%3A-how-to-get-header--Options-tf3604648.html#a10086555

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>
> 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Lakshmanan Venkatachalam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509331 ] 

Lakshmanan Venkatachalam commented on AXIS2-2593:
-------------------------------------------------

Thanks Michele and Dims for your quick response. 

I have created a another bug for my issue.

https://issues.apache.org/jira/browse/AXIS2-2883

I appreciate if you could look into it.

thanks
Lakshmanan

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2593) Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495024 ] 

Davanum Srinivas commented on AXIS2-2593:
-----------------------------------------

Yep!

> Web Service request loop causes many TIME_WAIT Connections & "BindException: Address already in use: connect"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2593
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2593
>             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
>            Priority: Critical
>         Attachments: diff.txt, JIRA-935_2593.zip, 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):
> 	java.net.BindException: 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, 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(AxisFault.java:377)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
> 		at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:310)
> 		at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:202)
> 		at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:446)
> 		at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
> 		at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 		at com.ws.service.MyServiceStub.performService(MyServiceStub.java:300)
> 		at com.ws.client.MyClient.main(MyClient.java:88)
> 	Caused by: java.net.BindException: Address already in use: connect
> 		at java.net.PlainSocketImpl.socketConnect(Native Method)
> 		at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 		at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 		at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 		at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 		at java.net.Socket.connect(Socket.java:519)
> 		at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:585)
> 		at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 		at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 		at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 		at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 		at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 		at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
> 		at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
> 		... 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org