tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Port still busy after removing connector in Embedded Tomcat 7.0.30
Date Mon, 13 May 2013 21:11:13 GMT
On 13/05/2013 16:34, Chirag Dewan wrote:
> Hi,
> 
> I am embedding  Apache Tomcat 7.0.30 in my application. I am using the Tomcat class,and
my application requires dynamic addition and removal of connectors(HTTP).
> 
> Now while removing the connectors,the application gets undeployed but the port remains
occupied and the connector continue to listen on the port. I am using customized HTTP connector.
> 
> 
>   Here is a snippet from my source code:
> 
> for removing connector:
> 
> if( connector != null )
>         {
>             connector.decUsage();
>             if( connector.getUsage() == 0 )
>             {
>                 connector.stop();
>                 this.tomcat.getService().removeConnector( connector );
>             }
>         }
> 
> for adding connector:
> 
> this.tomcat.getService().addConnector( connector );
> 
> 
> I know the port is not getting free. Because when I try to deploy to the same port again,it
gives me an address already in use exception.
> I have surfed for this issue a lot,but to no avail. Any help would be greatly appreciated.

You need to destroy the connector to close the port.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message