Re: Start Tomcat6 service with StartMode as java

2012-05-08 Thread Venkata R Madugundu
Hi,

We have been trying to run Tomcat6 windows service to spawn java.exe
instead of loading having JVM loaded in process.
I have tried to follow through all the documentation of Tomcat6 and procrun
to use StartMode as 'java'.

But no matter how I tweak the arguments, the StartMode with 'java' does not
seem to work. Do you know if there is a deterministic way to make it work.
We are using Tomcat 6.0.20

Here is the relevant content of the service install script.

---
set INSTALL_DIR=%~dp0

rem Tomcat 'catalina home' and 'catalina base' paths
cd ..
set CATALINA_HOME=%cd%
set CATALINA_BASE=%CATALINA_HOME%
cd .\bin

rem Java path relative to ASBNode
set ASBNODE_DIR=%INSTALL_DIR:\Clients\MetaBrokersAndBridges\web\bin\=%
set ASBNODE_DIR=%ASBNODE_DIR%\ASBNode
set
JVM_OPTIONS=-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf
\logging.properties

set SERVICE_NAME=MBB
set SERVICE_EXECUTABLE=%CATALINA_HOME%\bin\tomcat6.exe

set OPTIONS=--DisplayName IBM InfoSphere Metadata Integration Bridges
set OPTIONS=%OPTIONS% --Description IBM InfoSphere Metadata Integration
Bridges
set OPTIONS=%OPTIONS% --Install %SERVICE_EXECUTABLE%
set OPTIONS=%OPTIONS% --LogPath %CATALINA_BASE%\logs
set OPTIONS=%OPTIONS% --Classpath %CATALINA_HOME%\bin
\bootstrap.jar;%CATALINA_HOME%\bin\tomcat-juli.jar
set OPTIONS=%OPTIONS% --StartMode Java
set OPTIONS=%OPTIONS% --StopMode Java
set OPTIONS=%OPTIONS% --JavaHome %ASBNODE_DIR%\apps\jre
set OPTIONS=%OPTIONS% --StartClass org.apache.catalina.startup.Bootstrap
set OPTIONS=%OPTIONS% --StartParams start
set OPTIONS=%OPTIONS% --StopClass org.apache.catalina.startup.Bootstrap
set OPTIONS=%OPTIONS% --StopParams stop
set OPTIONS=%OPTIONS% --JvmOptions %JVM_OPTIONS%
set OPTIONS=%OPTIONS% --StdOutput auto
set OPTIONS=%OPTIONS% --StdError auto
set OPTIONS=%OPTIONS% --JvmMs 128
set OPTIONS=%OPTIONS% --JvmMx 1024
set OPTIONS=%OPTIONS% --LogLevel Debug

%SERVICE_EXECUTABLE% //IS//%SERVICE_NAME% %OPTIONS%
if not errorlevel 1 goto end
echo Failed installing '%SERVICE_NAME%' service
goto end

echo The service '%SERVICE_NAME%' has been installed.
:end
cd %INSTALL_DIR%
---

Thanks
Venkat


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



RE: Start Tomcat6 service with StartMode as java

2012-05-08 Thread Filip Hanik (mailing lists)
The Java Service Wrapper does this for you, if you want to try an
alternative
http://wrapper.tanukisoftware.com/doc/english/download.jsp


 -Original Message-
 From: Venkata R Madugundu [mailto:venkataraman...@in.ibm.com]
 Sent: Tuesday, May 08, 2012 8:07 AM
 To: Venkata R Madugundu
 Cc: users@tomcat.apache.org
 Subject: Re: Start Tomcat6 service with StartMode as java
 
 Hi,
 
 We have been trying to run Tomcat6 windows service to spawn java.exe
 instead of loading having JVM loaded in process.
 I have tried to follow through all the documentation of Tomcat6 and
 procrun
 to use StartMode as 'java'.
 
 But no matter how I tweak the arguments, the StartMode with 'java' does
 not
 seem to work. Do you know if there is a deterministic way to make it
 work.
 We are using Tomcat 6.0.20
 
 Here is the relevant content of the service install script.
 
 
 
 ---
 set INSTALL_DIR=%~dp0
 
 rem Tomcat 'catalina home' and 'catalina base' paths
 cd ..
 set CATALINA_HOME=%cd%
 set CATALINA_BASE=%CATALINA_HOME%
 cd .\bin
 
 rem Java path relative to ASBNode
 set ASBNODE_DIR=%INSTALL_DIR:\Clients\MetaBrokersAndBridges\web\bin\=%
 set ASBNODE_DIR=%ASBNODE_DIR%\ASBNode
 set
 JVM_OPTIONS=-Dcatalina.base=%CATALINA_BASE%;-
 Dcatalina.home=%CATALINA_HOME%;-
 Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-
 Djava.io.tmpdir=%CATALINA_BASE%\temp;-
 Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-
 Djava.util.logging.config.file=%CATALINA_BASE%\conf
 \logging.properties
 
 set SERVICE_NAME=MBB
 set SERVICE_EXECUTABLE=%CATALINA_HOME%\bin\tomcat6.exe
 
 set OPTIONS=--DisplayName IBM InfoSphere Metadata Integration Bridges
 set OPTIONS=%OPTIONS% --Description IBM InfoSphere Metadata Integration
 Bridges
 set OPTIONS=%OPTIONS% --Install %SERVICE_EXECUTABLE%
 set OPTIONS=%OPTIONS% --LogPath %CATALINA_BASE%\logs
 set OPTIONS=%OPTIONS% --Classpath %CATALINA_HOME%\bin
 \bootstrap.jar;%CATALINA_HOME%\bin\tomcat-juli.jar
 set OPTIONS=%OPTIONS% --StartMode Java
 set OPTIONS=%OPTIONS% --StopMode Java
 set OPTIONS=%OPTIONS% --JavaHome %ASBNODE_DIR%\apps\jre
 set OPTIONS=%OPTIONS% --StartClass org.apache.catalina.startup.Bootstrap
 set OPTIONS=%OPTIONS% --StartParams start
 set OPTIONS=%OPTIONS% --StopClass org.apache.catalina.startup.Bootstrap
 set OPTIONS=%OPTIONS% --StopParams stop
 set OPTIONS=%OPTIONS% --JvmOptions %JVM_OPTIONS%
 set OPTIONS=%OPTIONS% --StdOutput auto
 set OPTIONS=%OPTIONS% --StdError auto
 set OPTIONS=%OPTIONS% --JvmMs 128
 set OPTIONS=%OPTIONS% --JvmMx 1024
 set OPTIONS=%OPTIONS% --LogLevel Debug
 
 %SERVICE_EXECUTABLE% //IS//%SERVICE_NAME% %OPTIONS%
 if not errorlevel 1 goto end
 echo Failed installing '%SERVICE_NAME%' service
 goto end
 
 echo The service '%SERVICE_NAME%' has been installed.
 :end
 cd %INSTALL_DIR%
 
 
 ---
 
 Thanks
 Venkat
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



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



Re: Start Tomcat6 service with StartMode as java

2012-05-08 Thread Konstantin Kolinko
2012/5/8 Venkata R Madugundu venkataraman...@in.ibm.com:
 Hi,

 We have been trying to run Tomcat6 windows service to spawn java.exe
 instead of loading having JVM loaded in process.
 I have tried to follow through all the documentation of Tomcat6 and procrun
 to use StartMode as 'java'.

You have to go to Apache Commons Daemon project and read their docs
(and sources)


 But no matter how I tweak the arguments, the StartMode with 'java' does not
 seem to work. Do you know if there is a deterministic way to make it work.
 We are using Tomcat 6.0.20


Old...  The commons-daemon bundled there is also old.


 Here is the relevant content of the service install script.

 ---
 set INSTALL_DIR=%~dp0

 rem Tomcat 'catalina home' and 'catalina base' paths
 cd ..
 set CATALINA_HOME=%cd%
 set CATALINA_BASE=%CATALINA_HOME%
 cd .\bin

 rem Java path relative to ASBNode
 set ASBNODE_DIR=%INSTALL_DIR:\Clients\MetaBrokersAndBridges\web\bin\=%
 set ASBNODE_DIR=%ASBNODE_DIR%\ASBNode
 set
 JVM_OPTIONS=-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf
 \logging.properties

 set SERVICE_NAME=MBB
 set SERVICE_EXECUTABLE=%CATALINA_HOME%\bin\tomcat6.exe

 set OPTIONS=--DisplayName IBM InfoSphere Metadata Integration Bridges
 set OPTIONS=%OPTIONS% --Description IBM InfoSphere Metadata Integration
 Bridges
 set OPTIONS=%OPTIONS% --Install %SERVICE_EXECUTABLE%
 set OPTIONS=%OPTIONS% --LogPath %CATALINA_BASE%\logs
 set OPTIONS=%OPTIONS% --Classpath %CATALINA_HOME%\bin
 \bootstrap.jar;%CATALINA_HOME%\bin\tomcat-juli.jar
 set OPTIONS=%OPTIONS% --StartMode Java
 set OPTIONS=%OPTIONS% --StopMode Java
 set OPTIONS=%OPTIONS% --JavaHome %ASBNODE_DIR%\apps\jre
 set OPTIONS=%OPTIONS% --StartClass org.apache.catalina.startup.Bootstrap
 set OPTIONS=%OPTIONS% --StartParams start
 set OPTIONS=%OPTIONS% --StopClass org.apache.catalina.startup.Bootstrap
 set OPTIONS=%OPTIONS% --StopParams stop
 set OPTIONS=%OPTIONS% --JvmOptions %JVM_OPTIONS%
 set OPTIONS=%OPTIONS% --StdOutput auto
 set OPTIONS=%OPTIONS% --StdError auto
 set OPTIONS=%OPTIONS% --JvmMs 128
 set OPTIONS=%OPTIONS% --JvmMx 1024
 set OPTIONS=%OPTIONS% --LogLevel Debug

 %SERVICE_EXECUTABLE% //IS//%SERVICE_NAME% %OPTIONS%
 if not errorlevel 1 goto end
 echo Failed installing '%SERVICE_NAME%' service
 goto end

 echo The service '%SERVICE_NAME%' has been installed.
 :end
 cd %INSTALL_DIR%


I'd first configure everything via GUI.  I think I am not mistaken
that all the parameters that you are passing above are settable
through prunmgr GUI.

That is if java mode actually does work on Windows
(I have never tried it, and that would be a Commons Daemon question).

Why do you want java.exe? Why cannot you start Tomcat with a *.bat file?

Also IIRC it was mentioned several times that in Vista and later
services cannot interact with Desktop. You have not mentioned what
your OS is.

Best regards,
Konstantin Kolinko

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