> If the context was removed, but the Connector was still there, should you not > get a 404 Not Found, rather than a timeout ?
If I am calling the removeConnector,shouldn't it cleanup the context and the free the port? I mean is my context blocking the connector even after I removed it? i should get a 404. Yes. Sorry I forget to mention,it worked fine with Tomcat 6 Embedded version. I am trying to upgrade it to Tomcat 7.0.30 and I am following the same process as in Tomcat 6. Thanks ________________________________ From: André Warnier <a...@ice-sa.com> To: Tomcat Users List <users@tomcat.apache.org> Sent: Monday, 13 May 2013 10:13 PM Subject: Re: Port still busy after removing connector in Embedded Tomcat 7.0.30 Chirag Dewan wrote: >> How do you observe that the connector is still bound to the port? > > Yes. I used netstat to observe that. Plus when I try to add another context > to the same port,I get "Address already in use" exception. > >> What does it show? > > I can see my java process running on that port. > >> What happens if you make a request? > > As I said,I am sure that the deployed context is removed. I get a timeout on >a request. If the context was removed, but the Connector was still there, should you not get a 404 Not Found, rather than a timeout ? > > When I start my Tomcat Server(tomcat.start()),I understand it adds a default > connector to the service on port 8080,so after adding my connector on port > 1090,i can see my java process listening on port 1090 and 8080. > > I really dont understand what wrong I might be doing. > > > Thanks > > > > > > > > ________________________________ > From: Christopher Schultz <ch...@christopherschultz.net> > To: Tomcat Users List <users@tomcat.apache.org> > Sent: Monday, 13 May 2013 9:47 PM > Subject: Re: Port still busy after removing connector in Embedded Tomcat > 7.0.30 > > > -----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-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org