dexter
dexter

Reputation: 285

Not able to stop the tomcat server in linux

I am trying to stop the tomcat server through linux command.

 ./catalina.sh stop

using the above command is giving following error message :

Using CATALINA_BASE:   /opt/Arpita/arpita_apache-tomcat-7.0.47
Using CATALINA_HOME:   /opt/Arpita/arpita_apache-tomcat-7.0.47
Using CATALINA_TMPDIR: /opt/Arpita/arpita_apache-tomcat-7.0.47/temp
Using JRE_HOME:        /opt/./jdk1.7.0_01/
Using CLASSPATH:       /opt/Arpita/arpita_apache-tomcat-7.0.47/bin/bootstrap.jar:/opt/Arpita/arpita_apache-tomcat-7.0.47/bin/tomcat-juli.jar
Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:741]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
./catalina.sh: line 446: 22194 Aborted                 "/opt/./jdk1.7.0_01//bin/java" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=172.18.15.15 -XX:MaxPermSize=128M -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/root/ -Dchef.endpoint=https://172.19.24.112:443 -Daricloud.home=/opt/Arpita/properties -Duser.home=/opt/chef-repo -Duser.name=root -Duser.password=abc123 -Dchef.client=admin -Dchef.validator=chef-validator -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1889 -Xdebug -Xnoagent -Djava.compiler=NONE -Dguice.executor.class -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=1024m -Djava.endorsed.dirs="/opt/Arpita/arpita_apache-tomcat-7.0.47/endorsed" -classpath "/opt/Arpita/arpita_apache-tomcat-7.0.47/bin/bootstrap.jar:/opt/Arpita/arpita_apache-tomcat-7.0.47/bin/tomcat-juli.jar" -Dcatalina.base="/opt/Arpita/arpita_apache-tomcat-7.0.47" -Dcatalina.home="/opt/Arpita/arpita_apache-tomcat-7.0.47" -Djava.io.tmpdir="/opt/Arpita/arpita_apache-tomcat-7.0.47/temp" org.apache.catalina.startup.Bootstrap stop

I have started the server using ./catalina.sh stop command.

Upvotes: 2

Views: 1370

Answers (2)

Mark Thomas
Mark Thomas

Reputation: 16615

You've added one or more debug options to JAVA_OPTS so the scripts try to use them during start and stop. Since the debug port is already in use when Tomcat is running, you see this failure when you try to invoke stop (which also starts a Java process).

You should use CATALINA_OPTS rather than JAVA_OPTS in nearly all use cases.

Also, the Tomcat scripts include support for debugging. You need to set the appropriate environment variables (see the comment at the beginning of catalina.sh) and then start Tomcat with ./catalina.sh jpda start.

Finally, if you want to stop Tomcat via kill, try kill -15 <pid> first since that invokes the standard shutdown process rather than kill -9 <pid> which doesn't do a clean shutdown.

Upvotes: 3

dexter
dexter

Reputation: 285

I found the way to kill the server, first I found its process Id using : ps -eaf | grep tomcat then killed the required process using its processId by : kill -9 *ID*

Upvotes: 2

Related Questions