Thursday, January 12, 2012

How to kill Apache Tomcat without restart your computer

Are you using Eclipse to start/stop you Apache Tomcat? If Yes, have you encountered error regarding the required ports already been used and you are sure there is no other Tomcat running on the same machine.

This problem happens in my working environment very often. I am not sure what causing the tomcat stop improperly and failed to restart.

I try to kill the java process using ProcessExplorer but failed. The process still running no matter how many time I kill it.

If your run netstat in cmd you will see the port 8080 under the states of CLOSE_WAIT. Mean the connection is close from 1 end and the other end is waiting.

I have found 2 solutions

  1. Restart you machine
  2. Close the connection

You can restart you machine then the connection will close automatically. Else use 3rd party program to close the connection. I am using CurrPorts, you can download from http://www.nirsoft.net/utils/cports.html .

Just search for java process and right click “Close Selected TCP Connections”.

Hope this will help someone in the future.



4 comments:

Achini said...

Thank you very much...your valuable post gave me a great relief...

Unknown said...

Wow! thank you so much! it was so disturbing to me to restart my computer everytime...

Unknown said...
This comment has been removed by the author.
Unknown said...



Some times it is cause of proxy setting in your IDE
look at this

https://stackoverflow.com/a/57239770/3600935