No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

FAQ-how to reboot tomcat service

Publication Date:  2012-10-18 Views:  103 Downloads:  0
Issue Description
Tomcat service commonly work corporately with apache service, then how to start tomcat service correctly? 
Alarm Information
None
Handling Process
Step 1 log on to server with tomcat service and check tomcat service status, execute the command like below:
# ps -ef | grep java
Similar information display like below:
S1-R1-B2:/opt # ps -ef | grep java
root     19758     1  0 Nov30 pts/4    00:00:13 /opt/jdk1.6.0_14/bin/java -server -Xms64m -Xmx1024m -XX:PermSize=64m -XX:MaxNewSize=256m -XX:MaxPermSize=128m -Dfile.encoding=GBK -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/apache-tomcat-6.0.18/conf/logging.properties -Djava.endorsed.dirs=/opt/apache-tomcat-6.0.18/endorsed -classpath :/opt/apache-tomcat-6.0.18/bin/bootstrap.jar -Dcatalina.base=/opt/apache-tomcat-6.0.18 -Dcatalina.home=/opt/apache-tomcat-6.0.18 -Djava.io.tmpdir=/opt/apache-tomcat-6.0.18/temp org.apache.catalina.startup.Bootstrap start
If there is information like below, it means tomcat process exists. If log do not report error, it run normally, log check method is like below:
# tail -f -n500 %TOMCAT_HOME%/logs/catalina.out
Normal start do not have java error, display similar information (partial) like below:
[2011/11/30 19:36:48][%q] [INFO] [%k] [org.springframework.web.context.ContextLoader,200] Root WebApplicationContext: initialization completed in 2781 ms
……
Nov 30, 2011 7:36:48 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8100
……
Nov 30, 2011 7:36:48 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/19  config=null
Nov 30, 2011 7:36:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3792 ms
Instruction: %TOMCAT_HOME% is directory of tomcat, like /opt/apache-tomat-6.0.18/, check if apache process exists, execute the command like below:
# ps -ef |grep httpd
Similar information display like below:
S1-R1-B2:/opt # ps -ef |grep httpd
root     17971     1  0 Nov30 ?        00:00:00 /opt/apache-2.2.17/bin/httpd -k start -f /opt/apache-2.2.17/conf/httpd.conf
daemon   17972 17971  0 Nov30 ?        00:00:00 /opt/apache-2.2.17/bin/httpd -k start -f /opt/apache-2.2.17/conf/httpd.conf
If there is information like above, apache service would start normally
If it needs to reboot tomcat service, execute step 2.
Step 2 stop apache and tomat service
Stop apache service, execute command like below:
# /opt/apache-2.2.17/bin/httpd -k stop -f /opt/apache-2.2.17/conf/httpd.conf
If stop fail, then close compulsorily, execute command like below:
# killall -9 httpd
Stop tomcat service, execute command like below:
# %TOMCAT_HOME%/bin/shutdown.sh
If stop fail, then close process compulsorily, execute command like below:
# kill -9 [pid]
Instruction: %TOMCAT_HOME% is directory of tomcat, as /opt/apache-tomat-6.0.18/ pid is process id of tomcat, check with ps command.
Step 3 start apache service
Execute command like below:
# /opt/apache-2.2.17/bin/httpd -k start -f /opt/apache-2.2.17/conf/httpd.conf
Step 4 start tomcat service
Execute command like below:
# %TOMCAT_HOME%/bin/startup.sh
Step 5 check service status.
Check according to content of step 1, check if tomcat log excerpt, execute command like below:
# tail -f -n500 %TOMCAT_HOME%/logs/catalina.out
Normal start has no java error, display like information (partial) like below:
[2011/11/30 19:36:48][%q] [INFO] [%k] [org.springframework.web.context.ContextLoader,200] Root WebApplicationContext: initialization completed in 2781 ms
……
Nov 30, 2011 7:36:48 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8100
……
Nov 30, 2011 7:36:48 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/19  config=null
Nov 30, 2011 7:36:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3792 ms
When excerpt, it print similar information (partial) like below:
[2011/11/30 19:35:29][%q] [ERROR] [%k] [com.huaweisymantec.rental.resconfig.action.ResConfigAction,137] load resource groups fail :0004
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at java.lang.reflect.Method.invoke(Method.java:597)
……


Root Cause
None
Suggestions
None

END