Tomcat Windows Service - stops by itself.

W

Wojtek

Hi!

I have one instance of Tomcat which "stops by itself".
I have installed Tomcat as a Windows Service several time and I have never
had such a problem.

The situation is as follows:

Windows 2003 Server Standard Edition SP1
Two instances of Apache Tomcat/5.0.18 installed as Service
Tomcat_A (server port 8005, http 8080, AJP 1.3 8009)
Tomcat_B (server port 8035, http 3030, AJP 1.3 8019)
Jakarta Isapi Redirector 2.0 (redirect into both Tomcats Tomcat_A 8009,
Tomcat_B 8019)
MySql (Windows Service)

Tomcat_A and Tomcat_B have identical settings, properties, there is exactly
the same application running on both of them and I have used the same batch
file to install both.
Both Services are set as "automatic".

And now: Tomcat_A works without problems 24/7 however the Tomcat_B every now
and then stops.
It doesn't add anything to the log before the stop. It is difficult to say
after how much time it stops - sometimes after several hours sometimes after
several days.
The only message which I managed to find is a line in Windows Event Viewer:
"tomcat entered the stop state".
When I start Tomcat_B from a batch file (runs in a cmd console) and leave
the session for a several days then it doesn't stop.

I have read lots of information in the internet however I cannot find a
solution to my problem. I was hoping you could help. Have you came a cross
such problem? If you haven't maybe you could give me a clue what to check.

Last Friday I have removed the "--server" option from the service.bat file I
used to install both Tomcats and reinstalled Tomcat_B. It doesn't prove
anything yet however the service hasn't stopped since then as previously it
could stop even after aprox. few weeks.
I have read that "--service" "increases efficiency and thus increase
performance" :) that is why I added that param in the first place. I also
read (from a different source) that there should not be two instances of
Tomcat on one machine with this option enabled. Is that truth? What does the
"--server" modifier really do/mean?

Any help from you would be much appreciated.

Many thanks,
Wojtek

p.s. The below is the service.bat I used to install both Tomcats:

if "%OS%" == "Windows_NT" setlocal
rem ---------------------------------------------------------------------------
rem NT Service Install/Uninstall script
rem
rem Options
rem install Install the service using Tomcat5 as service
name.
rem Service is installed using default settings.
rem remove Remove the service from the System.
rem
rem name (optional) If the second argument is present it is
considered
rem to be new service name
rem
rem $Id: service.bat,v 1.3 2003/12/24 04:40:43 billbarker Exp $
rem ---------------------------------------------------------------------------

rem Guess CATALINA_HOME if not defined
set CATALINA_HOME=d:\ebase\UfsServer\tomcat
set JAVA_HOME=D:\ebase\jdk

set CURRENT_DIR=%cd%
if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=d:\ebase\UfsServer\tomcat
if exist "%CATALINA_HOME%\bin\tomcat.exe" goto okHome
rem CD to the upper dir
rem cd ..
rem set CATALINA_HOME=%cd%
:gotHome
if exist "%CATALINA_HOME%\bin\tomcat.exe" goto okHome
echo The tomcat.exe was not found...
echo The CATALINA_HOME environment variable is not defined correctly.
echo This environment variable is needed to run this program
goto end
:eek:kHome

set EXECUTABLE=%CATALINA_HOME%\bin\tomcat.exe

rem Set default Service name
set SERVICE_NAME=Tomcat5

if "%1" == "" goto displayUsage
if "%2" == "" goto setServiceName
set SERVICE_NAME=%2
:setServiceName
if %1 == install goto doInstall
if %1 == remove goto doRemove
echo Unknown parameter "%1"
:displayUsage
echo
echo Usage: service.bat install/remove [service_name]
goto end

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_NAME%
echo The service '%SERVICE_NAME%' has been removed
goto end

:doInstall

rem Install the service

"%EXECUTABLE%" //IS//%SERVICE_NAME% --DisplayName %2" Tomcat" --Description
"Intranet Tomcat Server - http://jakarta.apache.org/tomcat/" --Install
"%EXECUTABLE%" --ImagePath
"%CATALINA_HOME%\bin\bootstrap.jar" --StartupClass
org.apache.catalina.startup.Bootstrap;main;start --ShutdownClass
org.apache.catalina.startup.Bootstrap;main;stop --Java java --Startup auto

rem Set extra parameters

set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=8001

"%EXECUTABLE%"
//US//%SERVICE_NAME% --JavaOptions -Dcatalina.home="\"%CATALINA_HOME%\""#-Djava.endorsed.dirs="\"%CATALINA_HOME%\common\endorsed\""#-Xrs#-server#-Xmx512m#-Djava.awt.headless=true#-Xdebug#-Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n
--StdOutputFile "%CATALINA_HOME%\logs\stdout.log" --StdErrorFile
"%CATALINA_HOME%\logs\stderr.log" --WorkingPath "%CATALINA_HOME%\bin"

echo The service '%SERVICE_NAME%' has been installed

:end
cd %CURRENT_DIR%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top