Novell Home

Detecting Tomcat Stops and Initializations

Novell Cool Solutions: Tip
By Mark Hinckley

Digg This - Slashdot This

Posted: 1 Jun 2005
 

Problem

Admins often ask themelves the following questions:

  • "How do I know when Tomcat has stopped, so I can restart it again?"
  • "How do I know when Tomcat has fully initialized itself so I can use iManager again?"

Solution

To reset Tomcat, you issue TC4STOP commands at the NetWare console, followed by the TOMCAT4 command. However, you need to wait for Tomcat to be completely stopped before issuing the start command.

Detecting Tomcat Stops

You can tell that Tomcat is stopped by watching the Logger screen for the following messages after issuing the TC4STOP command:

Using CATALINA_BASE:   sys:/tomcat/4
Using CATALINA_HOME:   sys:/tomcat/4
Using CATALINA_TMPDIR: sys:/tomcat/4/temp
Using JAVA_HOME:       SYS:\java
Doing a stop
java: Class org.apache.catalina.startup.Bootstrap exited successfully
Stopping service Tomcat-Standalone
java: Class org.apache.catalina.startup.Bootstrap exited successfully

These messages may not appear in this exact order, and often other unrelated messages will be interleaved among this set of messages. Sometimes the "Stopping service..." message will precede the first "java: Class.... successfully" message. The key is to watch for the two "exited successfully" messages. That is the indicator that Tomcat has finished its shutdown sequence and that is now safe to issue the TOMCAT4 command to start Tomcat again.

Detecting Tomcat Initializations

To determine when Tomcat has completed all its initialization process and is ready for iManager to be accessed again, watch the Logger screen for the following messages:

Using CATALINA_BASE:   sys:/tomcat/4
Using CATALINA_HOME:   sys:/tomcat/4
Using CATALINA_TMPDIR: sys:/tomcat/4/temp
Using JAVA_HOME:       SYS:\java 
Doing a start
java: Class com.novell.application.tomcat.util.tccheck.LDAPVerifier exited successfully
Starting service Tomcat-Standalone
Apache Tomcat/4.1.30
May 17, 2005 3:02:05 PM org.apache.struts.util.PropertyMessageResources 
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
May 17, 2005 3:02:06 PM org.apache.struts.util.PropertyMessageResources 
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
May 17, 2005 3:02:14 PM org.apache.struts.util.PropertyMessageResources 
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true
May 17, 2005 3:03:22 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:9010
May 17, 2005 3:03:22 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=16/696  config=sys:\tomcat\4\conf\jk2.properties

(This example uses May 17, 2005, but the current date will apply to the messages.)

These messages do not come out in a single block - it may take anywhere from one to 10 minutes before the last message is displayed. It all depends on how fast your server is and how busy it is. The key in this section is the third line from the bottom, with the "listening on /0.0.0.0:9010" message, which is telling you that Tomcat has now started listening on port 9010 for incoming requests. When you see that, you can restart or refresh iManager, and it will respond properly.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell