6

I have Apache 2.2 and 4 Tomcat7 instance is running

One of the tomcat is configured for 1500 threads and 1024 Mb of Java heap space as the web application require such a deal...

So at time i face a lot of user traffic and the application gets slow, i restart the tomcat for a fix which in-turn makes the service showing status 'STOPPING'enter image description here

vivek
  • 309
  • 1
  • 2
  • 8
  • Hello Vivek. Could you please elaborate a bit more on what is your question? – nikkatsa May 29 '14 at 09:00
  • Basically the application load is high i restart the tomcat at that time the tomcat service get struck in 'Stopping' status .... for which i need to restart the server machine – vivek May 29 '14 at 09:04
  • @vivek, Do you mind accepting my answer if it answered your query? – N00b Pr0grammer Dec 09 '17 at 09:16

2 Answers2

18

If you want to get out of this situation, you could follow the steps as shown below.

Open Command prompt (Run as Administrator) on Windows Vista and Win 7

Query Service details using the following command (where Tomcat_7.0.7 is the service name of the Tomcat instance):

sc queryex Tomcat_7.0.7

You will be able to find the details related to the service (as shown below):

C:\WINDOWS\system32>sc queryex Tomcat_7.0.7

        SERVICE_NAME: Tomcat_7.0.7
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 3  STOP_PENDING
                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x3
        WAIT_HINT          : 0x0
        PID                : 2340
        FLAGS              :

Now get the PID details from the above, use the command as shown below to kill it (to resolve the issue).

taskkill /PID 2340 /F

This page gives more details on the same!

Hope this helps!

N00b Pr0grammer
  • 4,503
  • 5
  • 32
  • 46
3

Take a thread dump to find out what part of your application is stopping Tomcat from shutting down cleanly. Provided you are using a reasonably recent Apache Tomcat 7 release, there is an option to generate a thread dump accessible via the configuration tool that sits in the system tray.

Mark Thomas
  • 16,339
  • 1
  • 39
  • 60