You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Vacharaphol Sirivat <va...@tnis.com> on 2006/04/05 06:10:07 UTC

how to use procrun (in Tomcat 5) to run daemon

Hi everybody
    I try to use commons daemon which be found in http://jakarta.apache.org/commons/daemon/ and I got an example from http://www.kickjava.com/src/org/apache/commons/daemon/SimpleDaemon.java.htm. I use tomcat on windows xp, so I have to use procrun (tomcat 5 has built in procrun). I cannot start that java daemon. I got message

"Windows could not start the SimpleDaemon on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific err code 0."

here is my bat to install service

tomcat5 //IS//SimpleDaemon --Description="Demonstrares how to write and register service" --DisplayName="SimpleDaemon" --install="C:\Program Files\Apache Software Foundation\Tomcat 5.5.9\bin\tomcat5.exe" --User="v" --Password="K" --Jvm="%JAVA_HOME%\jre\bin\server\jvm.dll" --JvmOptions="-Xrs" --Classpath="simpleDaemon.jar;%CLASSPATH%" --StartPath="C:\Documents and Settings\vacharaphol\My Documents\temp\encode\SimpleDaemon" --StartClass="org.apache.commons.daemon.SimpleDaemon" --StartMethod="Main" --StartParams="start" --StartMode="jvm" --StopClass="org.apache.commons.daemon.SimpleDaemon" --StopMethod="Main" -- StopParams="stop" --StopMode="jvm" --LogPath="C:\Documents and Settings\vacharaphol\My Documents\temp\encode\SimpleDaemon" --LogPrefix="SimpleDaemon" --LogLevel="INFO" --StdOutput="C:\Documents and Settings\vacharaphol\My Documents\temp\encode\SimpleDaemon\out.txt" --StdError="C:\Documents and Settings\vacharaphol\My Documents\temp\encode\SimpleDaemon\err.txt"

    I'm not sure StartMethod should be "Main" or not. Daemon Interface has no method main, and I found Tomcat Bootstrap has main but noted "use for test only". Example for use Tomcat as Service in Windows leave StartMethod which is "main" by default. Who have ever used commons-daemon with procrun (in tomcat) please give me you comment or command line sample.

    Thank you

Vacharaphol