For example, here is a result of putting an 'echo on' inside catalina.bat (for Tomcat 5.5.31):
Mon 19:17:06>"c:\jdk1.6.0_12\bin\java" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\conf\logging.properties" -Djava.endorsed.dirs="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\common\endorsed" -classpath "C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\bin\bootstrap.jar" -Dcatalina.base="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31" -Dcatalina.home="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31" -Djava.io.tmpdir="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\temp" org.apache.catalina.startup.Bootstrap start
To make this command run as a Windows Service started by Apache Commons Daemon, you could use the following command to install it (to use prunsrv.exe + jvm.dll):
prunsrv //IS ^
--Jvm=c:\jdk1.6.0_12\jre\bin\server.jvm.dll ^
++JvmOptions=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager ^
++JvmOptions=-Djava.util.logging.config.file="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\conf\logging.properties"^
++JvmOptions=-Djava.endorsed.dirs="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\common\endorsed" ^
--Classpath="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\bin\bootstrap.jar" ^
++JvmOptions=-Dcatalina.base="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31" ^
++JvmOptions=-Dcatalina.home="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31" ^
++JvmOptions=-Djava.io.tmpdir="C:\work\appservers\tomcat\5.5\apache-tomcat-5.5.31\temp" ^
--StartMode=jvm ^
--StartClass=org.apache.catalina.startup.Bootstrap ^
++StartParams start
Next, add options for logging and for stopping the service.
To be more precise (ie - use the JDKs 'default' jvm, as the original command does), you would want to use a start mode of Java:
prunsrv //IS ^
--JavaHome=c:\jdk1.6.0_12 ^
--StartMode=Java ^
That would launch c:\jdk1.6.0_12\bin\java.exe as a separate process.
Read full article from Commons - User - [DAEMON] procrun - java Property File
No comments:
Post a Comment