Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat won't stop or restart

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?

like image 599
TheCoder Avatar asked Sep 11 '12 12:09

TheCoder


People also ask

How do I stop a program from running in Tomcat?

Access Tomcat Manager via URL http://ip:8080/manager, you will see a list of running applications. And from this, you can stop any webapp which you want.

How do I restart Apache Tomcat?

To restart Apache Tomcat on Microsoft WindowsOn a command prompt, type services. msc . Right-click Apache Tomcat Tomcat6, and click Restart.


1 Answers

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.

like image 196
Scala Enthusiast Avatar answered Sep 28 '22 05:09

Scala Enthusiast