Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 33F6711344 for ; Mon, 13 May 2013 18:07:31 +0000 (UTC) Received: (qmail 40767 invoked by uid 500); 13 May 2013 16:18:10 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 40713 invoked by uid 500); 13 May 2013 16:18:10 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 40704 invoked by uid 99); 13 May 2013 16:18:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 May 2013 16:18:10 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [76.96.59.228] (HELO qmta15.westchester.pa.mail.comcast.net) (76.96.59.228) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 May 2013 16:18:03 +0000 Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta15.westchester.pa.mail.comcast.net with comcast id bNzk1l0031wpRvQ5FUHNRC; Mon, 13 May 2013 16:17:22 +0000 Received: from Christophers-MacBook-Pro.local ([69.143.109.145]) by omta18.westchester.pa.mail.comcast.net with comcast id bUHL1l00y38FjT13eUHMGD; Mon, 13 May 2013 16:17:22 +0000 Message-ID: <5191121B.3000509@christopherschultz.net> Date: Mon, 13 May 2013 12:17:31 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Port still busy after removing connector in Embedded Tomcat 7.0.30 References: <1368459254.93560.YahooMailNeo@web190701.mail.sg3.yahoo.com> In-Reply-To: <1368459254.93560.YahooMailNeo@web190701.mail.sg3.yahoo.com> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1368461842; bh=oFctC5+vxZ6pPlHsF8Dg+PEjKQi86I8qUf7vSh/PC7g=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=Qg9uJGJptcp+u/5sayscAzhaSwdq0TeMdlAdIPhDSg2OToGMdpGamM2OeequTuLr9 1A438jDbd4iCkrvPG4OCUZgLrdDhPC3fkq2puuJAWjIHwPsSjnhsqMckVnHcCjj/Oh 6U3K5GmTeUsXiLCDXoBVYKBIhxChBmS5cA+bKx5Dj1aTFO7f2yf0lsg4T+xf8rzT0p L9UNVl8CSDaZnDwF0/HdUKpoydLQWe4USJQwo7GqXDCp7Ia3drGgc+pLQjDqY+pO1G breQsywQV1EfPkdgSrjpqebqrM5XRXBGLTaTUn0n/E1BErtFQSS8ScVAS392r6SQZP YRep3WUlJ+PHA== X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Chirag, On 5/13/13 11:34 AM, Chirag Dewan wrote: > 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. Can you take a thread dump and find which code look like it's doing connection-related things? How do you observe that the connector is still bound to the port? netstat? What does it show? What happens if you make a request? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJRkRIbAAoJEBzwKT+lPKRYH4kP/2WiZK75ifzqSXojAw1ckw6k iH5NvnWNNFeibFvqtj0tN2Nun+mb3atqs4ySwQahN/FAtz8klhdfGLTlccMxzh4u x1yvMKLEh1Xr3qTxeot/y98zER/gubdgNsM4lr5MkkFVtaprK7/emz1OCwcuZe0L XApJRuSNF+GxtH9lSKEw4Tn4kzc5Asv2gMQOQmLAmBi3fKI9MsoRS9V5TPU88dhL XBk+rkcUdvL2KWKbP9yrt2Geu9NqBzqADCA4FJUESS9sm8A/VECzyUZ+4uW/jqiP qpn4GSAtpaH9CyHzynZF5qyA8Fx+BllhyIFwZfUl5DMqk+t4gw3LdPay8Rkpfg7G fdLHXrLez/Pcj2nvOp60OLeC4DD13AJON9KyYXmnUuk29aV/lrOes9nmUbIVDh8k 2LXh9cYErtD55bCgmTLPT0bLBpC9v1aUGEjFzeLjfJX9hEkvpUrN5OWvKHYg5Vaw 2qc+bV31qitjrUfZYU58S5UX1txATx6Ig76y/pt49XfiQFc6/GG25Ju5UCJOpat0 mOV4qTck+Exy+YuGvME7V/IcLAbymm9vGIB4bQD9dLq36Kx0cL5lE/DOYANd2PJD 0nBO/co4uRvKW54NDnHVzzpAU7IUXBoQ+SmU4IQMv1+TP6auHO8ekwDW7+59ZgCc Ev3xtRom84ly50SQcxKf =zDpF -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org