You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Pär Malmqvist <pa...@hotmail.com> on 2007/11/14 15:46:40 UTC

RE: Address already in use: connect

Hello!
 
The problem with "Address already in use: connect" exception for an Axis2 client when executing thousends of calls is solved by:
 
Options options = stub._getServiceClient().getOptions();
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
 
So it might be good to change the default value for HTTPConstants.REUSE_HTTP_CLIENT
to TRUE for the client generated by the wsdl2java tool.
 
What do you gurus think?
 
/Pär
 
 
 
 
> Subject: Re: Address already in use: connect> From: Michele.Mazzucco@ncl.ac.uk> To: axis-user@ws.apache.org> Date: Wed, 10 Oct 2007 10:54:29 +0100> > Try to set some custom options [1], like caching/reusing the same http> client and throttling the max number of connections.> > Michele> > [1]> http://svn.apache.org/viewcvs.cgi//webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/async/AsyncService2Test.java> > > On Wed, 2007-10-10 at 11:13 +0200, Pär Malmqvist wrote:> > Hi!> > > > I have written a simple blocking client using Axis2 1.3 API's.> > > > When I do like this:> > > > for(int i = 0; i < 1000000; i++) {> > ...> > ServiceClient sender = new ServiceClient();> > sender.sendReceive(payload);> > ...> > }> > > > there is no problem. The client runs for many hours.> > > > > > > > When I do like this:> > > > ServiceClient sender = new ServiceClient();> > > > for(int i = 0; i < 1000000; i++) {> > ...> > sender.sendReceive(payload);> > ....> > sender.cleanup();> > sender.cleanupTransport();> > > > }> > > > I get exception ....AxisFault: Address already in use: connect> > after a couple of thousand calls.> > > > It seems to be something wrong in the ServiceClient class which> > shows up after a while.> > Any ideas?> > > > /Pär Malmqvist> > > > > > > > > > > > > > > > > > > > ______________________________________________________________________> > Explore the seven wonders of the world Learn more!> > > ---------------------------------------------------------------------> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org> For additional commands, e-mail: axis-user-help@ws.apache.org> 
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

Re: Address already in use: connect

Posted by Paul Fremantle <pz...@gmail.com>.
Seems like a good idea to me!

Can you please raise a JIRA under the improvement tag?

Paul

On Nov 14, 2007 2:46 PM, Pär Malmqvist <pa...@hotmail.com> wrote:

>  Hello!
>
> The problem with "Address already in use: connect" exception for an
> Axis2 client when executing thousends of calls
> is solved by:
>
>
> Options options =
> stub._getServiceClient().getOptions(); options.setProperty(HTTPConstants.*
> REUSE_HTTP_CLIENT*, Boolean.*TRUE*);
>
> So it might be good to change the default value for HTTPConstants.*
> REUSE_HTTP_CLIENT*
> to TRUE for the client generated by the wsdl2java tool.
>
> What do you gurus think?
>
> /Pär
>
>
>
>
>
>
> > Subject: Re: Address already in use: connect
> > From: Michele.Mazzucco@ncl.ac.uk
> > To: axis-user@ws.apache.org
> > Date: Wed, 10 Oct 2007 10:54:29 +0100
>
> >
> > Try to set some custom options [1], like caching/reusing the same http
> > client and throttling the max number of connections.
> >
> > Michele
> >
> > [1]
> >
> http://svn.apache.org/viewcvs.cgi//webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/async/AsyncService2Test.java
> >
> >
> > On Wed, 2007-10-10 at 11:13 +0200, Pär Malmqvist wrote:
> > > Hi!
> > >
> > > I have written a simple blocking client using Axis2 1.3 API's.
> > >
> > > When I do like this:
> > >
> > > for(int i = 0; i < 1000000; i++) {
> > > ...
> > > ServiceClient sender = new ServiceClient();
> > > sender.sendReceive(payload);
> > > ...
> > > }
> > >
> > > there is no problem. The client runs for many hours.
> > >
> > >
> > >
> > > When I do like this:
> > >
> > > ServiceClient sender = new ServiceClient();
> > >
> > > for(int i = 0; i < 1000000; i++) {
> > > ...
> > > sender.sendReceive(payload);
> > > ....
> > > sender.cleanup();
> > > sender.cleanupTransport();
> > >
> > > }
> > >
> > > I get exception ....AxisFault: Address already in use: connect
> > > after a couple of thousand calls.
> > >
> > > It seems to be something wrong in the ServiceClient class which
> > > shows up after a while.
> > > Any ideas?
> > >
> > > /Pär Malmqvist
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > ______________________________________________________________________
> > > Explore the seven wonders of the world Learn more!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
> ------------------------------
> Get news, entertainment and everything you care about at Live.com. Check
> it out! <http://www.live.com/getstarted.aspx+>
>



-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

RE: Address already in use: connect

Posted by Pär Malmqvist <pa...@hotmail.com>.
Hi Michele!
 
I have also added:
options.setCallTransportCleanup(true);
to my generated client.
 
Do you know of any more cleanup calls I should do to use the wsdl2java generated client in a correct way?
My main goal is to to get the wsdl2java client work fine.
 
/Pär
 
 
> From: Michele.Mazzucco@ncl.ac.uk> Subject: Re: Address already in use: connect> Date: Wed, 14 Nov 2007 14:50:48 +0000> To: axis-user@ws.apache.org> > I think that this is not solution.> > The problem arises because your code doesn't cleanup the used > resources properly.> When you (re)use the same http client you can't see the problem only > because you're using only 1 object.> > Michele> > On 14 Nov 2007, at 14:46, Pär Malmqvist wrote:> > > Hello!> >> > The problem with "Address already in use: connect" exception for an > > Axis2 client when executing thousends of calls> > is solved by:> >> > Options options = stub._getServiceClient().getOptions();> >> > options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);> >> > So it might be good to change the default value for > > HTTPConstants.REUSE_HTTP_CLIENT> > to TRUE for the client generated by the wsdl2java tool.> >> > What do you gurus think?> >> > /Pär> >> >> >> >> >> >> > > Subject: Re: Address already in use: connect> > > From: Michele.Mazzucco@ncl.ac.uk> > > To: axis-user@ws.apache.org> > > Date: Wed, 10 Oct 2007 10:54:29 +0100> > >> > > Try to set some custom options [1], like caching/reusing the same > > http> > > client and throttling the max number of connections.> > >> > > Michele> > >> > > [1]> > > http://svn.apache.org/viewcvs.cgi//webservices/axis2/trunk/java/ > > modules/integration/test/org/apache/axis2/async/AsyncService2Test.java> > >> > >> > > On Wed, 2007-10-10 at 11:13 +0200, Pär Malmqvist wrote:> > > > Hi!> > > >> > > > I have written a simple blocking client using Axis2 1.3 API's.> > > >> > > > When I do like this:> > > >> > > > for(int i = 0; i < 1000000; i++) {> > > > ...> > > > ServiceClient sender = new ServiceClient();> > > > sender.sendReceive(payload);> > > > ...> > > > }> > > >> > > > there is no problem. The client runs for many hours.> > > >> > > >> > > >> > > > When I do like this:> > > >> > > > ServiceClient sender = new ServiceClient();> > > >> > > > for(int i = 0; i < 1000000; i++) {> > > > ...> > > > sender.sendReceive(payload);> > > > ....> > > > sender.cleanup();> > > > sender.cleanupTransport();> > > >> > > > }> > > >> > > > I get exception ....AxisFault: Address already in use: connect> > > > after a couple of thousand calls.> > > >> > > > It seems to be something wrong in the ServiceClient class which> > > > shows up after a while.> > > > Any ideas?> > > >> > > > /Pär Malmqvist> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > > > > ______________________________________________________________________> > > > Explore the seven wonders of the world Learn more!> > >> > >> > > > > ---------------------------------------------------------------------> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org> > > For additional commands, e-mail: axis-user-help@ws.apache.org> > >> >> >> > Get news, entertainment and everything you care about at Live.com. > > Check it out!> > > ---------------------------------------------------------------------> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org> For additional commands, e-mail: axis-user-help@ws.apache.org> 
_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

Re: Address already in use: connect

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
I think that this is not solution.

The problem arises because your code doesn't cleanup the used  
resources properly.
When you (re)use the same http client you can't see the problem only  
because you're using only 1 object.

Michele

On 14 Nov 2007, at 14:46, Pär Malmqvist wrote:

> Hello!
>
> The problem with "Address already in use: connect" exception for an  
> Axis2 client when executing thousends of calls
> is solved by:
>
> Options options = stub._getServiceClient().getOptions();
>
> options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
>
> So it might be good to change the default value for  
> HTTPConstants.REUSE_HTTP_CLIENT
> to TRUE for the client generated by the wsdl2java tool.
>
> What do you gurus think?
>
> /Pär
>
>
>
>
>
>
> > Subject: Re: Address already in use: connect
> > From: Michele.Mazzucco@ncl.ac.uk
> > To: axis-user@ws.apache.org
> > Date: Wed, 10 Oct 2007 10:54:29 +0100
> >
> > Try to set some custom options [1], like caching/reusing the same  
> http
> > client and throttling the max number of connections.
> >
> > Michele
> >
> > [1]
> > http://svn.apache.org/viewcvs.cgi//webservices/axis2/trunk/java/ 
> modules/integration/test/org/apache/axis2/async/AsyncService2Test.java
> >
> >
> > On Wed, 2007-10-10 at 11:13 +0200, Pär Malmqvist wrote:
> > > Hi!
> > >
> > > I have written a simple blocking client using Axis2 1.3 API's.
> > >
> > > When I do like this:
> > >
> > > for(int i = 0; i < 1000000; i++) {
> > > ...
> > > ServiceClient sender = new ServiceClient();
> > > sender.sendReceive(payload);
> > > ...
> > > }
> > >
> > > there is no problem. The client runs for many hours.
> > >
> > >
> > >
> > > When I do like this:
> > >
> > > ServiceClient sender = new ServiceClient();
> > >
> > > for(int i = 0; i < 1000000; i++) {
> > > ...
> > > sender.sendReceive(payload);
> > > ....
> > > sender.cleanup();
> > > sender.cleanupTransport();
> > >
> > > }
> > >
> > > I get exception ....AxisFault: Address already in use: connect
> > > after a couple of thousand calls.
> > >
> > > It seems to be something wrong in the ServiceClient class which
> > > shows up after a while.
> > > Any ideas?
> > >
> > > /Pär Malmqvist
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >  
> ______________________________________________________________________
> > > Explore the seven wonders of the world Learn more!
> >
> >
> >  
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
> Get news, entertainment and everything you care about at Live.com.  
> Check it out!


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Address already in use: connect

Posted by Deepal jayasinghe <de...@gmail.com>.
> Hello!
>  
> The problem with "Address already in use: connect" exception for an
> Axis2 client when executing thousends of calls 
> is solved by:
>  
>
> Options options = stub._getServiceClient().getOptions();
>
> options.setProperty(HTTPConstants./REUSE_HTTP_CLIENT/, Boolean./TRUE/);
>  
> So it might be good to change the default value for
> HTTPConstants./REUSE_HTTP_CLIENT/
> to TRUE for the client generated by the wsdl2java tool.
Try to do
stub._getServiceClient().cleanupTransport();

Thanks
Deepal

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org