Apache Tomcat "Stopping"

Apache Tomcat service “Stopping”

Apache takes a silly amount of time to stop its service. It’s not something I need to do often, but when I do, the Tomcat service seems to hang in a status of “Stopping” for at least 10 minutes.

I have no idea why it does this, but I haven’t the enthusiasm to explore. You could restart your machine if you like, but sometimes this is not possible or ideal (especially if on a production server).

A quick way around it that I am recording for my own benefit mostly:

  1. Open Task Manager: [ctrl] + [alt] + [delete], then click “Task Manager” then click on the “Services” tab.
  2. Find your Tomcat service: In the list of services, find the name of the Apache Tomcat service with a status of “Stopping”. Make a note of this service name (not case sensitive).
  3. Run the Command Prompt: Open the “Start” menu, type “cmd”, then right-click on the “Command Prompt” and click “Run as administrator”.
  4. Check the Service Status: Enter the command “sc queryex Tomcat6” into the command prompt (replace “Tomcat6” with the name of your tomcat service as shown in step 2)
    force_stop_apacheIt should then present you with the status of that service, including the process ID (PID).
  5. Kill the service: Enter the following command “taskkill /PID 2248 /F” where “2248” is the PID as found in step 4. Note: you need the “/f” argument to “force” the task to be killed.
  6. Success: You should get the confirmation message “SUCCESS: The process with PID 2248 has been terminated”

 

4 thoughts on “Apache Tomcat service “Stopping”

  1. S. Lindon Philip Martin

    Dear Phil
    Wonderful the way you drafted the step by step information with screenshots.
    really helpful. Appreciate it. God Bless

    Reply

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.