Tomcat won't stop or restart

TheCoder picture TheCoder · Sep 11, 2012 · Viewed 127.4k times · Source

I tried stopping tomcat. It failed with this message:

  • Tomcat did not stop in time. PID file was not removed.

I then tried again and got this:

  • PID file (/opt/tomcat/work/catalina.pid) found but no matching process was found. Stop aborted.

I then tried starting tomcat in debug mode and got this:

  • PID file (/opt/tomcat/work/catalina.pid) found. Is Tomcat still running? Start aborted.

I them deleted /opt/tomcat/work/catalina.pid and tried restarting and got this:

  • $CATALINA_PID was set (/opt/tomcat/work/catalina.pid) but the specified file does not exist. Is Tomcat running? Stop aborted.

Anyone know how to get tomcat restarted?

Answer

Scala Enthusiast picture Scala Enthusiast · Nov 24, 2016

I had this error message having started up a second Tomcat server on a Linux server.

$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted.

When starting up the 2nd Tomcat I had set CATALINA_PID as asked but my mistake was to set it to a directory (I assumed Tomcat would write a default file name in there with the pid).

The fix was simply to change my CATALINA_PID to add a file name to the end of it (I chose catalina.pid from the above examples). Next I went to the directory and did a simple:

touch catalina.pid

creating an empty file of the correct name. Then when I did my shutdown.sh I got the message back saying:

PID file is empty and has been ignored.
Tomcat stopped.

I didn't have the option to kill Tomcat as the JVM was in use so I was glad I found this.