1
votes

I'm running Eclipse 4.6.1 with in-IDE Tomcat 8.5.6 on Windows 10 Professional 64-bit Anniversary Edition.

After Tomcat is left running in Eclipse after some time, the Tomcat embedded in Eclipse can no longer be stopped. I press the red "Stop" button in the "Servers" tab, but nothing happens. Eventually Eclipse will ask me if I want to terminate Tomcat:

Server Tomcat v8.5 Server at localhost is not responding. Do you want to terminate this server? Click OK to terminate the server or click Cancel to continue waiting.

I click "OK to terminate the server... but Tomcat keeps running.

Unfortunately when I then try to close Eclipse, it hangs on "Saving workbench state." Finally I have to kill Eclipse, thereby losing my workbench state. Even worse, if I then start Eclipse back up and try to restart the embedded Tomcat, I get the following error:

'Starting Tomcat v8.5 Server at localhost' has encountered a problem.

Several ports (8005, 8080, 8009) required by Tomcat v8.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

How can I surgically go in and really kill Tomcat so that it doesn't hang Eclipse and keep ports open? (Unfortunately the only thing that shows up in the task manager is Eclipse.exe. There is no Tomcat to be seen. I've tried killing the javaw.exe subprocess, but that doesn't help.)

(At one point I thought this was related to a VPN connection going down, but today this happened with no VPN connection at all.)

I've filed Eclipse Bug 511342. We'll see if anything comes of it.

4
Maybe you can terminate Tomcat before quitting Eclipse? - Guilherme Campos Hazan
Um, that is the question. Remember that I'm running Tomcat inside Eclipse --- hence the "in-IDE" remark in the question. - Garret Wilson

4 Answers

1
votes

i've tried locally but i couldn't recreate the bug .

im not sure that this answers your question but it is for sure something worth trying , in any case this might show some features to other users....

in the window menu you have the SHOW VIEW , there you can choose other enter image description here

this open the future window with search bar and all the available views for the ide . enter image description here

in the debug view , you can do actions not only on applications , but on servers also . the menu here is different from the view you see in the server, and you can do advanced termination other things.

enter image description here

welp , hope that helps .

*note , you don't need the server to run in debug mode .

0
votes

Find your Tomcat installation directory, navigate to bin folder, open a command window there and execute an .bat file named shutdown.bat, this way you can kill tomcat directly, make sure to locate the appropiate Tomcat installation directory which Eclipse is using.

UPDATE - Expected output: enter image description here

0
votes

I have not used it in the same way you have, but this may help.

On a command prompt (Cmd.exe) execute:

netstat -a -o | find "8080"

That will list all IP/PORT in use alongside the PID (process id) filtering by port # 8080 (change it to meet your needs or remove the find if you want to list all) Open Task Manager, and using the PID you should be able to find the particular process that is using the ports you need to release. updated: Once you find the port (8080) you can try using the command

taskkill /f /pid [port number]  

Found a related issue with this command: Stack overflow - Tomcat not shutting down eclipse

Again, I use this when I need to find a rogue thing that I need to kill, and I don't know if the embedded environment will show it separate but its worth a try.

-2
votes

In tomcat's console inside Eclipse, there's a red button that can stop it. Albert also stated that in task manager it appears as javaw.exe, however Eclipse itself also appears as javaw.exe, so be careful when killing each one. Eclipse should be the one that takes more memory.