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 "Lakshmanan Venkatachalam (JIRA)" <ji...@apache.org> on 2007/06/30 23:53:04 UTC

[jira] Created: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

CLOSE_WAIT slowly building up over the period of time.
------------------------------------------------------

                 Key: AXIS2-2883
                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: client-api
    Affects Versions: 1.1
         Environment: Operating System : Solaris 
Axis2 Version : 1.1
Application Server : weblogic 8.1 SP6
Using with Cocoon and weblogic DSP
            Reporter: Lakshmanan Venkatachalam
            Priority: Critical


I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 

We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.

It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.

But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.

Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.

Below is our client code for your reference.

private WebServiceResponse invokeWebservice(OMElement inputElement,
			Options options) throws WebServiceInvokerException {
		ServiceClient serviceClient = null;
		try {
			serviceClient = new ServiceClient();

			serviceClient.setOptions(options);

			// This following line of code is used when we are using
			// WS-Addressing. User has to make sure the addressing MAR file in
			// class path before enable the following line of code
			//

			// serviceClient.engageModule(new QName(
			// org.apache.axis2.Constants.MODULE_ADDRESSING));

			// Invoking synchrounous webservice
			//
			OMElement result = serviceClient.sendReceive(inputElement);
			
			OMNode firstOMChild = result.getFirstOMChild();

			// Conver the OMelements to XML String
			//
			Writer stringWriter = new StringWriter();
			firstOMChild.serialize(stringWriter);
            serviceClient.cleanup();
			stringWriter.flush();

			// Return the Axis2WebserviceResponse
			//
			return new Axis2WebServiceResponse(stringWriter.toString());

		} catch (AxisFault afe) {
			throw new WebServiceInvokerException(afe);
		} catch (XMLStreamException xse) {
			throw new WebServiceInvokerException(xse);
		} catch (IOException ioe) {
			throw new WebServiceInvokerException(ioe);
		} finally {
			try {
				serviceClient.cleanup();
                serviceClient=null;
			} catch (AxisFault axisFault) {
				//
			}
		}

	}
}

options are:

Options options = new Options();
		options.setTo(targetEPR);
		options.setUseSeparateListener(false);
		options.setAction(wsRequest.getAction());
		options.setTimeOutInMilliSeconds(600000);
		options.setTransportInProtocol("http");
		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);


 

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Brecht Yperman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783105#action_12783105 ] 

Brecht Yperman commented on AXIS2-2883:
---------------------------------------

I am now seeing 26 connections in CLOSE_WAIT (there were none this morning).

The request rate is currently at about 100 per minute.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Work started: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

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

Work on AXIS2-2883 started by Glen Daniels.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Chi Chi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664231#action_12664231 ] 

Chi Chi commented on AXIS2-2883:
--------------------------------

Hello

I am experiencing a similar issue. I have upgraded from Axis2 v1.3 to Axis2 v.1.4.1, in the hope of fixing this issue that way, but to no avail.

Can anyone help? I note there is a workaround listed above:

"The workaround is to keep a reference to the connection manager and force it to close idle/stale connections. "

However, I am not sure how I would go about doing this - can someone please post an example?

Other than the above is there any other solution?

Thanks
Chi Chi

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Michael Mathers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664318#action_12664318 ] 

Michael Mathers commented on AXIS2-2883:
----------------------------------------


System.gc() works for me in the meantime.  It may or may not work for
you.

Michael
 



> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

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

Michele Mazzucco commented on AXIS2-2883:
-----------------------------------------

Michael, in my previous comment I've also said that there's a workaround.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

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

Michele Mazzucco commented on AXIS2-2883:
-----------------------------------------

Indeed I was wrong... it happens on Mac OS as well. The workaround is to keep a reference to the connection manager and force it to close idle/stale connections.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705367#action_12705367 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-2883:
-----------------------------------------------------

Has some one tried with a client as given below to get this work with http 1.1?

With http 1.1 it is possible to use keep alive to enhance the performance and reduce the
number of connections made to the server. i.e when you use keep alive feature client only create one connection with the server. So there is no possibility to get multiple CLOSE_WAIT state connections.

By default axis2 creates a httpClient for each and every request. Hence it creates different MultiThreadedHttpConnectionManager objects for different invocations. Actually this stops axis2 uses keep alive by default. In order to switch on keep alive one have to set the same http client for all the invocations as show below.

you can verify whether actually it uses keep alive or not using tcpmon. It should send all the messages using only one tcp connection.


------------------------------------------------------------------------------------------------------------------------------------
MultiThreadedHttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager();
            HttpConnectionManagerParams params = new HttpConnectionManagerParams();
            HostConfiguration hostConfiguration = new HostConfiguration();
            hostConfiguration.setHost("localhost", 8085);
            params.setMaxTotalConnections(100);
            params.setMaxConnectionsPerHost(hostConfiguration, 25);
            httpConnectionManager.setParams(params);

            HttpClient httpClient = new HttpClient(httpConnectionManager);

            while (true) {

                try {

                    client = new ServiceClient(null, null);
                    Options opts = new Options();
                    client.setOptions(opts);
                    opts.setTo(new EndpointReference("http://localhost:8085/axis2/services/TestInOutService"));
                    opts.setAction("urn:TestInOutService");

                    OMElement payload = buildSoapObject(
                            "<ns1:getPrice xmlns:ns1=\"http://quickstart.samples/xsd\">" +
                                    "<ns1:symbol>IBM</ns1:symbol>" +
                                    "</ns1:getPrice>"
                    );
                    System.out.println("Sending the request ..." + System.currentTimeMillis());

                    client.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);
                    client.getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
                    client.sendReceive(payload);


                } catch (Exception e) {
                    e.printStackTrace();
                }
                finally {
                    if (client != null) {
                        try {
                            client.cleanupTransport();
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            client.cleanup();
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }

                }
                try {
                    Thread.sleep(1000);
                } catch (Exception e) {// do nothing}
                }
            }

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Rigadon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664612#action_12664612 ] 

Rigadon commented on AXIS2-2883:
--------------------------------

Micheal, thanks again for your response!

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

This is basically the same issue and needs fixing.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Michael Mathers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664561#action_12664561 ] 

Michael Mathers commented on AXIS2-2883:
----------------------------------------


I don't run it on every call either.  I keep a count and execute after a
certain number of times.  I am not on a high load application though so
I have freedom that you do not.   I am on Axis2 1.1 and it's dismaying
to me that this is not fixed yet even though it appears someone knows
exactly what to do about it (see Michele's comments).



> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Assigned: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

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

Glen Daniels reassigned AXIS2-2883:
-----------------------------------

    Assignee: Glen Daniels  (was: Deepal Jayasinghe)

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Michael Mathers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584707#action_12584707 ] 

Michael Mathers commented on AXIS2-2883:
----------------------------------------

Michele said:  "I think this bug should be fixed ASAP."


Indeed.  This critical issue is now 10 months old.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

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

Deepal Jayasinghe reassigned AXIS2-2883:
----------------------------------------

    Assignee: Deepal Jayasinghe

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Najati Imam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555353#action_12555353 ] 

Najati Imam commented on AXIS2-2883:
------------------------------------

Thanks for the update! I have a couple of hopefully easy questions to give us users some idea about how to proceed :-)

 - Is there any time frame for the next release?
 - Are there any tolerable hacks to tide us over?
 - System.gc() has been mentioned but doesn't necessarily clean the connection up, right? The vm can choose to ignore the "hint"?

Thanks again :-)

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "SomaSekharaReddy.K (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555374#action_12555374 ] 

SomaSekharaReddy.K commented on AXIS2-2883:
-------------------------------------------

Hello,

I have a work around here. You can avoid CLOSE_Wait's if you use Http
1.0 instead of Http 1.1 protocol at Service client. We have faced this
problem earlier. After using Http 1.0, this problem is not occurred and
our systems are stable with out CLOSE_WAIT's from last three months.

Thanks and Regards
SomaSekharaReddy.K



> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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] Issue Comment Edited: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Najati Imam (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555353#action_12555353 ] 

najati edited comment on AXIS2-2883 at 1/2/08 11:07 AM:
-------------------------------------------------------------

Thanks for the update! I have a couple of hopefully easy questions to give us users some idea about how to proceed :-)

 - Is there any time frame for the next release?
 - Are there any tolerable hacks to tide us over?
 - System.gc() has been mentioned but doesn't necessarily clean the connection up, right? The vm can choose to ignore the "hint"?

Thanks again :-)

(EDIT: I hope this isn't too close to user support. If it is I apologize.)

      was (Author: najati):
    Thanks for the update! I have a couple of hopefully easy questions to give us users some idea about how to proceed :-)

 - Is there any time frame for the next release?
 - Are there any tolerable hacks to tide us over?
 - System.gc() has been mentioned but doesn't necessarily clean the connection up, right? The vm can choose to ignore the "hint"?

Thanks again :-)
  
> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

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

gerhard presser updated AXIS2-2883:
-----------------------------------

    Comment: was deleted

(was: i'm also experiencing a strange behavior using https-webservices. (axis2 1.5.1)
on the SERVER-side, the connection-threads stay open until a timeout occurs.

because of the open threads, a new thread will be created on every new request.
i'm not sure if this is the same problem.

if i'm using the same webservice on the same systems via http, everything is fine.

i tested it in jetty and tomcat web-container - same result.)

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Glen Daniels (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784044#action_12784044 ] 

Glen Daniels commented on AXIS2-2883:
-------------------------------------

Hi Brecht:

I did not actually test this with https, so it is technically possible there's still an issue there... I won't likely be able to set up a harness to test with for a few days.  Let us know if you see further symptoms.

--Glen

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Updated: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

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

Davanum Srinivas updated AXIS2-2883:
------------------------------------

    Assignee:     (was: Davanum Srinivas)

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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] Issue Comment Edited: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "gerhard presser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791950#action_12791950 ] 

gerhard presser edited comment on AXIS2-2883 at 12/17/09 2:44 PM:
------------------------------------------------------------------

i'm also experiencing a strange behavior using https-webservices. (axis2 1.5.1)
on the SERVER-side, the connection-threads stay open until a timeout occurs.

because of the open threads, a new thread will be created on every new request.
i'm not sure if this is the same problem.

if i'm using the same webservice on the same systems via http, everything is fine.

i tested it in jetty and tomcat web-container - same result.

      was (Author: gpresser):
    i'm also experiencing a strange behavior using https-webservices.
on the SERVER-side, the connection-threads stay open until a timeout occurs.

because of the open threads, a new thread will be created on every new request.
i'm not sure if this is the same problem.

if i'm using the same webservice on the same systems via http, everything is fine.

i tested it in jetty and tomcat web-container - same result.
  
> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

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

SomaSekharaReddy.K commented on AXIS2-2883:
-------------------------------------------

This problem is exists even in Axis 1.3. i am getting CLOSE_WAIT's even after invoking serviceclient.cleanupTransport()

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Davanum Srinivas
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

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

Daniele Fiorellino commented on AXIS2-2883:
-------------------------------------------

Hi.

I've same problem.

Environment:  Operating System : Linux Red Hat Enterprise 4 Update 5
Axis2 Version : 1.2
Application Server : ApacheTomcat 5.5
Tomcat Version: Apache Tomcat 5.5.23
JVM Version: 1.6.0_02-b05 
OS Vers: Linux 2.6.9-55.0.6.ELsmp i386 

Have you news?
Bye.
DF


> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

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

Lakshmanan Venkatachalam commented on AXIS2-2883:
-------------------------------------------------

Kindly ignore ServiceClient=null in the finally  block on the code attached in the bug description. That was not on the deployed code.

This was tried as work around for the problem. 

thanks
Lakshmanan

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Aberle Martin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793635#action_12793635 ] 

Aberle Martin commented on AXIS2-2883:
--------------------------------------

Ich bin bis zum 04.01.2010 nicht im Büro. Ihre E-Mail wurde nicht weitergeleitet und wird erst nach meiner Rückkehr bearbeitet.


> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Vineeth Narayanan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836938#action_12836938 ] 

Vineeth Narayanan commented on AXIS2-2883:
------------------------------------------

Hi,

We are trying to upgrade from Axis2 1.4 to Axis2 1.5.1. We are using autogenerated stub from the wsdl using the wsdl2java maven plugin. Our code was running fine using 1.4 version but since upgrading to 1.5.1 we are facing a couple of issues. the approach which we had taken with 1.4 was to create a context once for the object in the constructor using a custom axis2.xml(though this is the same as the axis2.xml which comes with the Axis2 distribution. 

                context = ConfigurationContextFactory.createBasicConfigurationContext("axis2.xml");

We create a stub once using this context and then reuse this stub throughout the life cycle. While initializing the stub, we create an instance of the multithreadedHttpConnectionmanager and set its properties using the params object. we create a httpclient using this manager instance and cache the client in the context with client reuse flag set to true.

                MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
                HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
                // Maximum one socket connection to a specific host
                connectionManagerParams.setDefaultMaxConnectionsPerHost(1);
                connectionManagerParams.setTcpNoDelay(true);
                connectionManagerParams.setStaleCheckingEnabled(true);
                connectionManagerParams.setLinger(0);
                connectionManager.setParams(connectionManagerParams);
                HttpClient httpClient = new HttpClient(connectionManager);
                context.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
                    Boolean.TRUE);
                context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
                    httpClient);

                stub = new SoapStub(context,endPoint);

The endPoint is passed as a parameter to the constructor. We then use the stub to call the actual service method to get the response and call the cleanup method of the stub in the finally block. the stub code uses the operationClinet.execute(true) method. All this was runnig fine in 1.4. since migrating to 1.5.1 we first faced the issue where our server just hung after a couple of request as it was uanble to get a connection from the webservice. To overcome this I have tried to create a stub for each request. as well as creating a context for each request. The problem which we now face is that after about 100 requests we get the following error

2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.axis2.transport.http.HTTPSender - Unable to sendViaPost to url[http://uat.mds.gm.cib.intranet.db.com/mds_server_dapdev/MDSSoap]
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:525)
	at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
	at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
	at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
	at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

We have tried all possible combinations which  have been posted on different forums including setting the Options object but to no avail. We have tried calling the cleanuptransport method as well as calling the httpMehtod.releaseConnection & the Connectionmanager.closeIdleConnections in the finally block. But none of them resolve this issue. We cannot call Connectionmanager.shutdown as we then get the factory is shutdown error in subsequent calls. If we put a gc call in the finally block then all runs fine, but this slows up our application response time drastically. 

Is anybody else facing the same issue since migrating to 1.5.1? 

Since there is an inherent fix in 1.5.1 for the client reuse and CLOSE_WAIT issue, is there something that I need to change in my code? I am a newbie to using Axis2 for webservice.

I am sorry if this is not the correct forum to post this but I have exhausted all possible options to resolve this issue but am having no success. 

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "gerhard presser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791950#action_12791950 ] 

gerhard presser commented on AXIS2-2883:
----------------------------------------

i'm also experiencing a strange behavior using https-webservices.
on the SERVER-side, the connection-threads stay open until a timeout occurs.

because of the open threads, a new thread will be created on every new request.
i'm not sure if this is the same problem.

if i'm using the same webservice on the same systems via http, everything is fine.

i tested it in jetty and tomcat web-container - same result.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Issue Comment Edited: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Vineeth Narayanan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836938#action_12836938 ] 

Vineeth Narayanan edited comment on AXIS2-2883 at 2/22/10 10:07 PM:
--------------------------------------------------------------------

Hi,

We are trying to upgrade from Axis2 1.4 to Axis2 1.5.1. We are using autogenerated stub from the wsdl using the wsdl2java maven plugin. Our code was running fine using 1.4 version but since upgrading to 1.5.1 we are facing a couple of issues. the approach which we had taken with 1.4 was to create a context once for the object in the constructor using a custom axis2.xml(though this is the same as the axis2.xml which comes with the Axis2 distribution. 

                context = ConfigurationContextFactory.createBasicConfigurationContext("axis2.xml");

We create a stub once using this context and then reuse this stub throughout the life cycle. While initializing the stub, we create an instance of the multithreadedHttpConnectionmanager and set its properties using the params object. we create a httpclient using this manager instance and cache the client in the context with client reuse flag set to true.

                MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
                HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
                // Maximum one socket connection to a specific host
                connectionManagerParams.setDefaultMaxConnectionsPerHost(1);
                connectionManagerParams.setTcpNoDelay(true);
                connectionManagerParams.setStaleCheckingEnabled(true);
                connectionManagerParams.setLinger(0);
                connectionManager.setParams(connectionManagerParams);
                HttpClient httpClient = new HttpClient(connectionManager);
                context.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
                    Boolean.TRUE);
                context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
                    httpClient);

                stub = new SoapStub(context,endPoint);

The endPoint is passed as a parameter to the constructor. We then use the stub to call the actual service method to get the response and call the cleanup method of the stub in the finally block. the stub code uses the operationClinet.execute(true) method. All this was runnig fine in 1.4. since migrating to 1.5.1 we first faced the issue where our server just hung after a couple of request as it was uanble to get a connection from the webservice. To overcome this I have tried to create a stub for each request. as well as creating a context for each request. The problem which we now face is that after about 100 requests we get the following error

2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.axis2.transport.http.HTTPSender - Unable to sendViaPost to url[http://uat.cib.intranet.com/server_dapdev/Soap]
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:525)
	at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
	at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
	at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
	at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

We have tried all possible combinations which  have been posted on different forums including setting the Options object but to no avail. We have tried calling the cleanuptransport method as well as calling the httpMehtod.releaseConnection & the Connectionmanager.closeIdleConnections in the finally block. But none of them resolve this issue. We cannot call Connectionmanager.shutdown as we then get the factory is shutdown error in subsequent calls. If we put a gc call in the finally block then all runs fine, but this slows up our application response time drastically. 

Is anybody else facing the same issue since migrating to 1.5.1? 

Since there is an inherent fix in 1.5.1 for the client reuse and CLOSE_WAIT issue, is there something that I need to change in my code? I am a newbie to using Axis2 for webservice.

I am sorry if this is not the correct forum to post this but I have exhausted all possible options to resolve this issue but am having no success. 

      was (Author: vineeth):
    Hi,

We are trying to upgrade from Axis2 1.4 to Axis2 1.5.1. We are using autogenerated stub from the wsdl using the wsdl2java maven plugin. Our code was running fine using 1.4 version but since upgrading to 1.5.1 we are facing a couple of issues. the approach which we had taken with 1.4 was to create a context once for the object in the constructor using a custom axis2.xml(though this is the same as the axis2.xml which comes with the Axis2 distribution. 

                context = ConfigurationContextFactory.createBasicConfigurationContext("axis2.xml");

We create a stub once using this context and then reuse this stub throughout the life cycle. While initializing the stub, we create an instance of the multithreadedHttpConnectionmanager and set its properties using the params object. we create a httpclient using this manager instance and cache the client in the context with client reuse flag set to true.

                MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
                HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
                // Maximum one socket connection to a specific host
                connectionManagerParams.setDefaultMaxConnectionsPerHost(1);
                connectionManagerParams.setTcpNoDelay(true);
                connectionManagerParams.setStaleCheckingEnabled(true);
                connectionManagerParams.setLinger(0);
                connectionManager.setParams(connectionManagerParams);
                HttpClient httpClient = new HttpClient(connectionManager);
                context.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
                    Boolean.TRUE);
                context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
                    httpClient);

                stub = new SoapStub(context,endPoint);

The endPoint is passed as a parameter to the constructor. We then use the stub to call the actual service method to get the response and call the cleanup method of the stub in the finally block. the stub code uses the operationClinet.execute(true) method. All this was runnig fine in 1.4. since migrating to 1.5.1 we first faced the issue where our server just hung after a couple of request as it was uanble to get a connection from the webservice. To overcome this I have tried to create a stub for each request. as well as creating a context for each request. The problem which we now face is that after about 100 requests we get the following error

2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - I/O exception (java.net.BindException) caught when processing request: Address already in use: connect
2010-02-22 13:55:19,734 INFO  org.apache.commons.httpclient.HttpMethodDirector - Retrying request
2010-02-22 13:55:19,734 INFO  org.apache.axis2.transport.http.HTTPSender - Unable to sendViaPost to url[http://uat.mds.gm.cib.intranet.db.com/mds_server_dapdev/MDSSoap]
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:525)
	at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
	at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
	at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
	at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

We have tried all possible combinations which  have been posted on different forums including setting the Options object but to no avail. We have tried calling the cleanuptransport method as well as calling the httpMehtod.releaseConnection & the Connectionmanager.closeIdleConnections in the finally block. But none of them resolve this issue. We cannot call Connectionmanager.shutdown as we then get the factory is shutdown error in subsequent calls. If we put a gc call in the finally block then all runs fine, but this slows up our application response time drastically. 

Is anybody else facing the same issue since migrating to 1.5.1? 

Since there is an inherent fix in 1.5.1 for the client reuse and CLOSE_WAIT issue, is there something that I need to change in my code? I am a newbie to using Axis2 for webservice.

I am sorry if this is not the correct forum to post this but I have exhausted all possible options to resolve this issue but am having no success. 
  
> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Chi Chi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664441#action_12664441 ] 

Chi Chi commented on AXIS2-2883:
--------------------------------

Michael, thanks for your response!

I think, in fact, my problem is slightly different from the original one posted. I am working on a high load application, calling a webservice approximately every second! I am currently doing a performance test and the number of CLOSE_WAITs rises gradually over the course of the test.

I therefore do not think calling System.gc() is an option, certainly not EVERY time a webservice is called! For the moment I will have to leave this to the JVM.

So, does anyone actually know what the problem is? Is it due to failed service calls (eg - AxisFaults) or successful calls? Why does garbage collecting fix it? Presumably there is something called from the finalize method on the stub object? Can this not be called manually?

Back to the workaround:

"The workaround is to keep a reference to the connection manager and force it to close idle/stale connections. " 

Does anyone know how I would go about implementing this change?

Thanks
Jay

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Brecht Yperman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783069#action_12783069 ] 

Brecht Yperman commented on AXIS2-2883:
---------------------------------------

Hi, 

I am under the impression this problem is still there for https connections. Is this possible?

Thanks

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Updated: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

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

Andreas Veithen updated AXIS2-2883:
-----------------------------------

    Comment: was deleted

(was: Ich bin bis zum 04.01.2010 nicht im Büro. Ihre E-Mail wurde nicht weitergeleitet und wird erst nach meiner Rückkehr bearbeitet.
)

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "David Poon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555249#action_12555249 ] 

David Poon commented on AXIS2-2883:
-----------------------------------

We are in development to replace the use of jax-rpc with Axis2 for (j2ee) clients to invoke services. Our workload is thousands of concurrent users making thousands of service client calls. So we are interested in having this issue resolved. I have read these interrelated jira cases:

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

Whilst the issue is still unresolved, we are hoping to investigate at least one of the following workaround options under v1.3 of Axis2.

Option 1 - Use http v1.0 rather than v1.1

Option 2 - Create a new HttpClient for each client service operation call

Option 3 - One HttpClient shared by all service clients

Under option 2, we will instantiate a separate HttpClient for each service operation invocation. We link the HttpClient and service client instance by using the HTTPConstants.REUSE_HTTP_CLIENT and HTTPConstants.CACHED_HTTP_CLIENT options. Our client code will hold on to the reference to the HttpClient so that when the service operation is completed, we can get access to the Http Connection Manager (HCM) from the HttpClient. Once we got the HCM, we call its shutdown() method - which should close down all the connections in the underlying connection pool maintained bythe HCM.

Option 2 is essentially what Axis2 does by default (new HttpClient for every client service operation call). The difference is that under the Axis2 default behaviour, there is nothing to trigger the call to the HCM's shutdown() method. (Other "cleanup" methods are called, but as suggested by afore-mentioned jira cases, these other clean up methods ultimately does not close down the connections because under the http v1.1 protocol, they are keep "in waiting' in case they are reused - but they never are anyway under the Axis2 default behavior.)

Another interesting difference is that in the Axis2 AbstractHTTPSender.getHttpClient() method, we see that it does *not* bother to call its initializeTimeouts(msgContext, httpClient) method if it is reusing a HttpClient specified through the HTTPConstants.REUSE_HTTP_CLIENT and HTTPConstants.CACHED_HTTP_CLIENT options - so under option 2, we will have to write our own code to set the timeouts.

With option 3, we will create a HttpClient and configure its HCM pool size etc to cater for our expected workload. This HttpClient is then set into the ConfigurationContext instance that is shared by all service clients (actaully we use the wsdl-to-java generated Stubs). On application shutdown, we will call the HCM's shutdown() method.

We are *not* using https, so option 2 will probably suffice for us. 

I found the following Axis2 code useful and "interesting"...

public abstract class AbstractHTTPSender {
...
    protected HttpClient getHttpClient(MessageContext msgContext) {
        HttpClient httpClient;
        Object reuse = msgContext.getOptions().getProperty(HTTPConstants.REUSE_HTTP_CLIENT);
        if (reuse == null) {
            reuse = msgContext.getConfigurationContext().getProperty(HTTPConstants.REUSE_HTTP_CLIENT);
        }
        if (reuse != null && JavaUtils.isTrueExplicitly(reuse)) {
            httpClient = (HttpClient) msgContext.getOptions().getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
            if (httpClient == null) {
                httpClient = (HttpClient) msgContext.getConfigurationContext()
                        .getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
            }
            if (httpClient != null)
                return httpClient;
            MultiThreadedHttpConnectionManager connectionManager =
                new MultiThreadedHttpConnectionManager();
            httpClient = new HttpClient(connectionManager);
            msgContext.getConfigurationContext()
                .setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
        } else {
            HttpConnectionManager connManager =
                    (HttpConnectionManager) msgContext.getProperty(
                            HTTPConstants.MUTTITHREAD_HTTP_CONNECTION_MANAGER);
            if(connManager != null){
                httpClient = new HttpClient(connManager);
            } else {
                //Multi threaded http connection manager has set as the default 
                connManager = new MultiThreadedHttpConnectionManager();
                httpClient = new HttpClient(connManager);
            }
        }

        // Get the timeout values set in the runtime
        initializeTimeouts(msgContext, httpClient);
        return httpClient;
    }
...
======
public class HTTPSender extends AbstractHTTPSender {
...
    private void sendViaPost(MessageContext msgContext, URL url,
                             String soapActionString) throws AxisFault {


        HttpClient httpClient = getHttpClient(msgContext);
        ....
        try {
            executeMethod(httpClient, msgContext, url, postMethod);
            handleResponse(msgContext, postMethod);
        } catch (IOException e) {
            log.info("Unable to sendViaPost to url[" + url + "]", e);
            throw AxisFault.makeFault(e);
        } finally {
            cleanup(msgContext, postMethod);
        }
    }
=====
    private void cleanup(MessageContext msgContext, HttpMethod method) {
        if (msgContext.isPropertyTrue(HTTPConstants.AUTO_RELEASE_CONNECTION)) {
            method.releaseConnection();
        }
    }
=====

The use of HTTPConstants.AUTO_RELEASE_CONNECTION is only relevant for *asynchronous* service operation calls, so that does not help us.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

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

Davanum Srinivas updated AXIS2-2883:
------------------------------------

    Assignee: Davanum Srinivas

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Davanum Srinivas
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

-- 
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-2883) CLOSE_WAIT slowly building up over the period of time.

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

Glen Daniels resolved AXIS2-2883.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.1

Hi all.

This long-standing problem is now fixed.  See http://svn.apache.org/viewvc?rev=790721&view=rev.

When sharing a single ServiceClient, you need to either call client.transportCleanup() after each call or (easier) just use options.setCallTransportCleanup(true) to do it automatically (each call cleans up the last one).  

The fix is in the 1.5 branch and the trunk, and we're hoping to release 1.5.1 in the near future to get this into a released version.  Also hoping to produce a somewhat better resource management/release pattern for 1.6.

Please test (with the SVN versions or 1.5.1 when it's out) and let us know if you have any further problems.

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "jenny anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706561#action_12706561 ] 

jenny anderson commented on AXIS2-2883:
---------------------------------------

Amila,

I used axis2 tool  wsdi2java to generate  client code, I don't see MultiThreadedHttpConnectionManager  or HttpClient  in the generaetd stub class code at all.   I am guessing those code is under AXIS2 source code. Correct?  So  you are suggesting the user to modify AXIS2 source code?
Also, how to see whether the web service is using http1.0 or http1.1?

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Deepal Jayasinghe
>            Priority: Critical
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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


[jira] Commented: (AXIS2-2883) CLOSE_WAIT slowly building up over the period of time.

Posted by "Brecht Yperman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785823#action_12785823 ] 

Brecht Yperman commented on AXIS2-2883:
---------------------------------------

Hi,

we did see CLOSE_WAITs build up until the system stopped responding.

I will try to set up a test later today, but I don't have any experience developing Axis2, so I don't know where I will end up.

Brecht

> CLOSE_WAIT slowly building up over the period of time.
> ------------------------------------------------------
>
>                 Key: AXIS2-2883
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2883
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1
>         Environment: Operating System : Solaris 
> Axis2 Version : 1.1
> Application Server : weblogic 8.1 SP6
> Using with Cocoon and weblogic DSP
>            Reporter: Lakshmanan Venkatachalam
>            Assignee: Glen Daniels
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> I am experiencing theconstant increase in close wait in the production environment over the period 7 days. 
> We are using Synchronous webservices and we are calling two webservices 24 times every day. We have allocated the maximum of 1.5 GB per application instance and we have two application instances. We are utilizing maximum of 250 - 300 MB in average. So Full GC never runs in our environment.
> It seems like the client API ServiceClient.java is not cleaning up the resources associated with this component. We are creating the new ServiceClient component on every call we have for webservices. Though we have called the cleanup() method at the end of every call to the webservices. At times its not getting executed.
> But when we force garabage collection from the application, it was able to clear all the CLOSE_WAIT components. Since we have similar cleanup() call on finalize() method, it is able to do proper clean up when GC is collecting these objects.
> Forcing GC cannot be a solution, I like to hear from axis2 experts on how we can resolve this problem properly and what could be the cause for this happening.
> Below is our client code for your reference.
> private WebServiceResponse invokeWebservice(OMElement inputElement,
> 			Options options) throws WebServiceInvokerException {
> 		ServiceClient serviceClient = null;
> 		try {
> 			serviceClient = new ServiceClient();
> 			serviceClient.setOptions(options);
> 			// This following line of code is used when we are using
> 			// WS-Addressing. User has to make sure the addressing MAR file in
> 			// class path before enable the following line of code
> 			//
> 			// serviceClient.engageModule(new QName(
> 			// org.apache.axis2.Constants.MODULE_ADDRESSING));
> 			// Invoking synchrounous webservice
> 			//
> 			OMElement result = serviceClient.sendReceive(inputElement);
> 			
> 			OMNode firstOMChild = result.getFirstOMChild();
> 			// Conver the OMelements to XML String
> 			//
> 			Writer stringWriter = new StringWriter();
> 			firstOMChild.serialize(stringWriter);
>             serviceClient.cleanup();
> 			stringWriter.flush();
> 			// Return the Axis2WebserviceResponse
> 			//
> 			return new Axis2WebServiceResponse(stringWriter.toString());
> 		} catch (AxisFault afe) {
> 			throw new WebServiceInvokerException(afe);
> 		} catch (XMLStreamException xse) {
> 			throw new WebServiceInvokerException(xse);
> 		} catch (IOException ioe) {
> 			throw new WebServiceInvokerException(ioe);
> 		} finally {
> 			try {
> 				serviceClient.cleanup();
>                 serviceClient=null;
> 			} catch (AxisFault axisFault) {
> 				//
> 			}
> 		}
> 	}
> }
> options are:
> Options options = new Options();
> 		options.setTo(targetEPR);
> 		options.setUseSeparateListener(false);
> 		options.setAction(wsRequest.getAction());
> 		options.setTimeOutInMilliSeconds(600000);
> 		options.setTransportInProtocol("http");
> 		options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED, org.apache.axis2.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING);
>  

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