tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Himberger <sebastian.himber...@gmx.de>
Subject Problem: Installing Tomcat as Windows Service with StartMode=java or StartMode=exe
Date Mon, 06 Feb 2006 16:24:35 GMT
Hi list,

i'm trying to install Tomcat 5.5.12 as a Windows Service on "Windows 
Server 2003 Web Edition" and run it under another user as described 
here: http://tomcat.apache.org/tomcat-5.5-doc/windows-service-howto.html 
and http://jakarta.apache.org/commons/daemon/procrun.html . I tried 
setting StartMode to "exe" and to "java" but none of those seem to work. 
Installing as a service / using StartMode "jvm" works fine. The Service 
run's under the local system account

I already searched google and the mailing list archives but found no 
solution. I would be very glad if anyone can help me finding a solution 
that works or point me in the right direction.

Thanks very very much in advance

Sebastian Himberger

CATALINA_HOME: X:\...\Tomcat
CATALINA_BASE: X:\...\Tomcat
JAVA_HOME: X:\...\Java\JDK-1.5.0-1

Here's my install script:
---------------------------------------------------------------------------
@echo off

echo CATALINA_HOME: %CATALINA_HOME%
echo CATALINA_BASE: %CATALINA_BASE%
echo JAVA_HOME: %JAVA_HOME%
pause
set BASEDIR=%CATALINA_HOME%
call "%CATALINA_HOME%\bin\setclasspath.bat"

set args=%args% --Description=TomcatTest
set args=%args% --DisplayName=TomcatTest

set args=%args% --Startup=auto

set args=%args% --LogPath=%CATALINA_BASE%\logs
set args=%args% --LogLevel=DEBUG
set args=%args% --StdError=auto
set args=%args% --StdOutput=auto

set args=%args% --Classpath="%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar"

set args=%args% --JavaHome=%JAVA_HOME%
set args=%args% --Jvm=D:\...\Java\JDK-1.5.0-1\jre\bin\server\jvm.dll
set args=%args% 
--JvmOptions="-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed"

set args=%args% --StartMode=jvm
set args=%args% --StartClass=org.apache.catalina.startup.Bootstrap
set args=%args% --StartParams=start
rem set args=%args% --StartImage=%CATALINA_HOME%\bin\tomcat5.exe
rem set args=%args% --StartPath=%CATALINA_HOME%\bin

set args=%args% --StopMode=jvm
set args=%args% --StopClass=org.apache.catalina.startup.Bootstrap
set args=%args% --StopParams=stop
rem set args=%args% --StopImage=%CATALINA_HOME%\bin\tomcat5.exe
rem set args=%args% --StopPath=%CATALINA_HOME%\bin

tomcat5.exe //IS//TomcatTest %args%
set args=
set BASEDIR=
---------------------------------------------------------------------------

I get the following errors:

---------------------- StartMode = exe ------------------------

If it set no executable:
-------------------------------
[2006-02-06 17:20:13] [1253 prunsrv.c] [debug] Procrun log initialized
[2006-02-06 17:20:13] [info] Debuging Service...
[2006-02-06 17:20:13] [1075 prunsrv.c] [debug] Inside ServiceMain...
[2006-02-06 17:20:13] [info] Starting service...
[2006-02-06 17:20:13] [960  prunsrv.c] [error] Failed setting process 
executable
[2006-02-06 17:20:13] [1179 prunsrv.c] [error] ServiceStart returned 2
[2006-02-06 17:20:13] [info] Debug service finished.
[2006-02-06 17:20:13] [info] Procrun finished.
-------------------------------

If i set an executable with:

-------------------------------
set args=%args% --StartImage=%CATALINA_HOME%\bin\tomcat5.exe
set args=%args% --StartPath=%CATALINA_HOME%\bin
set args=%args% --StopImage=%CATALINA_HOME%\bin\tomcat5.exe
set args=%args% --StopPath=%CATALINA_HOME%\bin
-------------------------------

It returns:

stderr:
-------------------------------
[2006-02-06 17:22:37] [402  prunsrv.c] [error]
Das System kann die angegebene Datei nicht finden. (Cannot find file)
[2006-02-06 17:22:37] [1246 prunsrv.c] [error]
Load configuration failed
-------------------------------

service.log:
-------------------------------
[2006-02-06 17:22:34] [1253 prunsrv.c] [debug] Procrun log initialized
[2006-02-06 17:22:34] [513  prunsrv.c] [debug] Installing service...
[2006-02-06 17:22:34] [info] Service TomcatTest name TomcatTest
[2006-02-06 17:22:34] [555  prunsrv.c] [debug] Setting service 
description TomcatTest
[2006-02-06 17:22:34] [info] Service TomcatTest installed
[2006-02-06 17:22:34] [info] Procrun finished.
[2006-02-06 17:22:37] [1253 prunsrv.c] [debug] Procrun log initialized
[2006-02-06 17:22:37] [info] Debuging Service...
[2006-02-06 17:22:37] [1075 prunsrv.c] [debug] Inside ServiceMain...
[2006-02-06 17:22:37] [info] Starting service...
[2006-02-06 17:22:37] [info] Service started in 10 ms.
[2006-02-06 17:22:37] [1169 prunsrv.c] [debug] Waitning worker to finish...
[2006-02-06 17:22:37] [1174 prunsrv.c] [debug] Worker finished.
[2006-02-06 17:22:37] [info] Debug service finished.
[2006-02-06 17:22:37] [info] Procrun finished.
-------------------------------


---------------------- StartMode = java ------------------------

stderr:
-------------------------------
java.lang.NoClassDefFoundError: start Exception in thread "main"
-------------------------------
service.log:
-------------------------------
[2006-02-06 17:16:49] [1253 prunsrv.c] [debug] Procrun log initialized
[2006-02-06 17:16:49] [513  prunsrv.c] [debug] Installing service...
[2006-02-06 17:16:49] [info] Service TomcatTest name TomcatTest
[2006-02-06 17:16:49] [555  prunsrv.c] [debug] Setting service 
description TomcatTest
[2006-02-06 17:16:49] [info] Service TomcatTest installed
[2006-02-06 17:16:49] [info] Procrun finished.
[2006-02-06 17:16:54] [1253 prunsrv.c] [debug] Procrun log initialized
[2006-02-06 17:16:54] [info] Running Service...
[2006-02-06 17:16:54] [1075 prunsrv.c] [debug] Inside ServiceMain...
[2006-02-06 17:16:54] [info] Starting service...
[2006-02-06 17:16:54] [info] Service started in 30 ms.
[2006-02-06 17:16:55] [1169 prunsrv.c] [debug] Waitning worker to finish...
[2006-02-06 17:16:55] [1174 prunsrv.c] [debug] Worker finished.
[2006-02-06 17:16:55] [info] Run service finished.
[2006-02-06 17:16:55] [info] Procrun finished.
-------------------------------








---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message