I am facing some issues regarding tomcat startup and shutdown.
I am using
In my scenario to this problem, there were some threads not successfully terminated with shutdown message posted to tomcat, which made tomcat process still hanging around.
So I would start with plain tomcat instance..and keep adding the custom "wars" or changes one by one and make sure to stop tomcat successfully to narrow down the problem.
Following command does the trick:
service tomcat8 stop
These ones would be helpful too:
service tomcat8 start
service tomcat8 restart
Dont use /etc/bash.bashrc just put this on your catalina.sh
After:
if [ -r "$CATALINA_BASE"/bin/setenv.sh ]; then
. "$CATALINA_BASE"/bin/setenv.sh
elif [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
. "$CATALINA_HOME"/bin/setenv.sh
fi
put this:
export CATALINA_PID="$CATALINA_HOME/catalina_pid.txt"
And now your tomcat will be killed when you use catalina.sh stop -force
Solution; First set the pid of tomcat CATALINA_PID="/id.pid" export CATALINA_PID
then kill it catalina.sh stop -force
source: http://confluence.atlassian.com/pages/viewpage.action?pageId=216959212
otherwise just as you mentioned, just kill it with the kill command
ps aux | grep catalina
kill <pid of tomcat>
if the above two solutions don't fit your needs try the following:
$ sudo service tomcat6 stop
* Stopping Tomcat servlet engine tomcat6 [ OK ]
$ sudo service tomcat6 start
* Starting Tomcat servlet engine tomcat6 [ OK ]
$
or of course the more traditional way:
$ sudo /etc/init.d/tomcat6 stop
* Stopping Tomcat servlet engine tomcat6 [ OK ]
$ sudo /etc/init.d/tomcat6 start
* Starting Tomcat ser
I think the officially recommended way (according to catalina.sh inline comments) is:
#!/bin/sh
CATALINA_PID="$CATALINA_HOME/logs/catalina.pid"; export CATALINA_PID
chmod u+x setenv.sh
touch $CATALINA_HOME/logs/catalina.pid
The problem is caused because the address you use to start tomcat (in normal or debug mode) is already taken by another process.
You need to check the ports you are using in the you conf file (e.g. your_TOMCAT_HOME_DIR_/conf/server.xml), to see if they are not already used
Here you can look at the port used for
and if you are using Tomcat in debug mode (through jdpa or jdwp ), please make sure to use a different port than all the previous configured ports