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 Qi Cao <ca...@seamless.com.au> on 2007/02/22 08:06:21 UTC

axis2 in tomcat, java.net.BindException: Address already in use:

Hi There,

 

I was testing the Version web service in axis2, which is sitting in
tomcat 5.5.9.

And I've got a "java.net.BindException: Address already in use:" error
after I invoke the web service a few thousand times.

The exception state trace was printed by the client. The server,
however, showed nothing and just died in silence. I had to restart
tomcat in order to use the service again.

 

Do you have any idea about what may be the cause? Thanks in advance.

 

Cheers,

Qi

 

Client code and actual exception output:

 

I created a client stub by executing the command:



%AXIS_HOME%\bin\wsdl2java -uri
http://localhost:8080/axis2/service/Version?wsdl -p test.version -d adb
-s



and used it in the following manner.


public class test2 {

  public static void main(String args[]) throws AxisFault {

    Date start = new Date();

 

    try {

      VersionStub vs = new
VersionStub("http://ocalhost:9090/axis2/services/Version");

      for (int i = 0; i < 10000; i++) {

        //vs =
VersionStub("http://ocalhost:9090/axis2/services/Version"); //problem is
still there

        System.out.println(i+vs.getVersion().get_return());

        //vs.cleanup(); doesn't help

      }

    } catch (Exception e) {

      System.err.println(e.getMessage());

      e.printStackTrace();

    }

 

    System.out.println(new Date().getTime() - start.getTime());

  }

}

 

 

The web service is running ok and I did receive the version message. The
exception was usually thrown after the service was invoked 3000 to 5000
times.

 

The actural exception stack trace was:

 

22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry

INFO: I/O exception (java.net.BindException) caught when processing
request: Address already in use: connect

22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry

INFO: Retrying request

22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry

INFO: I/O exception (java.net.BindException) caught when processing
request: Address already in use: connect

22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry

INFO: Retrying request

22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry

INFO: I/O exception (java.net.BindException) caught when processing
request: Address already in use: connect

22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry

INFO: Retrying request

Address already in use: connect; nested exception is: 

      java.net.BindException: Address already in use: connect; nested
exception is: 

      org.apache.axis2.AxisFault: Address already in use: connect;
nested exception is: 

      java.net.BindException: Address already in use: connect

org.apache.axis2.AxisFault: Address already in use: connect; nested
exception is: 

      java.net.BindException: Address already in use: connect; nested
exception is: 

      org.apache.axis2.AxisFault: Address already in use: connect;
nested exception is: 

      java.net.BindException: Address already in use: connect

      at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common
sHTTPTransportSender.java:227)

      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:674)

      at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:237)

      at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisO
peration.java:202)

      at test.version.VersionStub.getVersion(VersionStub.java:117)

      at test2.main(test2.java:14)

Caused by: org.apache.axis2.AxisFault: Address already in use: connect;
nested exception is: 

      java.net.BindException: Address already in use: connect

      at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW
ithCommons(CommonsHTTPTransportSender.java:344)

      at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common
sHTTPTransportSender.java:204)

      ... 5 more

Caused by: java.net.BindException: Address already in use: connect

      at java.net.PlainSocketImpl.socketConnect(Native Method)

      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

      at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

      at java.net.Socket.connect(Socket.java:516)

      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)

     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:585)

      at
org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSoc
ket(ReflectionSocketFactory.java:139)

      at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.crea
teSocket(DefaultProtocolSocketFactory.java:124)

      at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:70
6)

      at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMe
thodDirector.java:386)

      at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho
dDirector.java:170)

      at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3
96)

      at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3
46)

      at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Abstrac
tHTTPSender.java:541)

      at
org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSend
er.java:119)

      at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW
ithCommons(CommonsHTTPTransportSender.java:335)

      ... 6 more

 

 


Re: axis2 in tomcat, java.net.BindException: Address already in use:

Posted by david2 <Da...@l-3comcept.com>.
Here is a web site Michele pointed me to addressing this OS limitation and
workarounds for Windows, AIX, & Solaris:

http://publib.boulder.ibm.com/infocenter/cmgmt/v8r3m0/index.jsp?topic=/com.ibm.eclient.doc/trs40019.htm

On Windows XP, I used TcpTimedWaitDelay=30 and MaxUserPort=65535

-David
-- 
View this message in context: http://www.nabble.com/axis2-in-tomcat%2C-java.net.BindException%3A-Address-already-in-use%3A-tf3271278.html#a10206571
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: axis2 in tomcat, java.net.BindException: Address already in use:

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Qi,

try to have a look here
http://wso2.org/library/165

Michele

On Thu, 2007-02-22 at 18:06 +1100, Qi Cao wrote:
> Hi There,
> 
>  
> 
> I was testing the Version web service in axis2, which is sitting in
> tomcat 5.5.9.
> 
> And I’ve got a “java.net.BindException: Address already in use:” error
> after I invoke the web service a few thousand times.
> 
> The exception state trace was printed by the client. The server,
> however, showed nothing and just died in silence. I had to restart
> tomcat in order to use the service again.
> 
>  
> 
> Do you have any idea about what may be the cause? Thanks in advance.
> 
>  
> 
> Cheers,
> 
> Qi
> 
>  
> 
> Client code and actual exception output:
> 
>  
> 
> I created a client stub by executing the command:
> 
> 
> 
> %AXIS_HOME%\bin\wsdl2java –uri
> http://localhost:8080/axis2/service/Version?wsdl –p test.version –d
> adb –s
> 
> 
> 
> and used it in the following manner.
> 
> 
> public class test2 {
> 
>   public static void main(String args[]) throws AxisFault {
> 
>     Date start = new Date();
> 
>  
> 
>     try {
> 
>       VersionStub vs = new
> VersionStub("http://ocalhost:9090/axis2/services/Version");
> 
>       for (int i = 0; i < 10000; i++) {
> 
>         //vs =
> VersionStub("http://ocalhost:9090/axis2/services/Version"); //problem
> is still there
> 
>         System.out.println(i+vs.getVersion().get_return());
> 
>         //vs.cleanup(); doesn’t help
> 
>       }
> 
>     } catch (Exception e) {
> 
>       System.err.println(e.getMessage());
> 
>       e.printStackTrace();
> 
>     }
> 
>  
> 
>     System.out.println(new Date().getTime() - start.getTime());
> 
>   }
> 
> }
> 
>  
> 
>  
> 
> The web service is running ok and I did receive the version message.
> The exception was usually thrown after the service was invoked 3000 to
> 5000 times.
> 
>  
> 
> The actural exception stack trace was:
> 
>  
> 
> 22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
> executeWithRetry
> 
> INFO: I/O exception (java.net.BindException) caught when processing
> request: Address already in use: connect
> 
> 22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
> executeWithRetry
> 
> INFO: Retrying request
> 
> 22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
> executeWithRetry
> 
> INFO: I/O exception (java.net.BindException) caught when processing
> request: Address already in use: connect
> 
> 22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
> executeWithRetry
> 
> INFO: Retrying request
> 
> 22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
> executeWithRetry
> 
> INFO: I/O exception (java.net.BindException) caught when processing
> request: Address already in use: connect
> 
> 22/02/2007 17:17:21 org.apache.commons.httpclient.HttpMethodDirector
> executeWithRetry
> 
> INFO: Retrying request
> 
> Address already in use: connect; nested exception is: 
> 
>       java.net.BindException: Address already in use: connect; nested
> exception is: 
> 
>       org.apache.axis2.AxisFault: Address already in use: connect;
> nested exception is: 
> 
>       java.net.BindException: Address already in use: connect
> 
> org.apache.axis2.AxisFault: Address already in use: connect; nested
> exception is: 
> 
>       java.net.BindException: Address already in use: connect; nested
> exception is: 
> 
>       org.apache.axis2.AxisFault: Address already in use: connect;
> nested exception is: 
> 
>       java.net.BindException: Address already in use: connect
> 
>       at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:227)
> 
>       at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:674)
> 
>       at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:237)
> 
>       at
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202)
> 
>       at test.version.VersionStub.getVersion(VersionStub.java:117)
> 
>       at test2.main(test2.java:14)
> 
> Caused by: org.apache.axis2.AxisFault: Address already in use:
> connect; nested exception is: 
> 
>       java.net.BindException: Address already in use: connect
> 
>       at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:344)
> 
>       at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:204)
> 
>       ... 5 more
> 
> Caused by: java.net.BindException: Address already in use: connect
> 
>       at java.net.PlainSocketImpl.socketConnect(Native Method)
> 
>       at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> 
>       at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> 
>       at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> 
>       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> 
>       at java.net.Socket.connect(Socket.java:516)
> 
>       at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
> 
>      at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 
>       at java.lang.reflect.Method.invoke(Method.java:585)
> 
>       at
> org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
> 
>       at
> org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
> 
>       at
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
> 
>       at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
> 
>       at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 
>       at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 
>       at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 
>       at
> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:541)
> 
>       at
> org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:119)
> 
>       at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:335)
> 
>       ... 6 more
> 
>  
> 
>  
> 
> 


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