> From: srijithu...@india.com
> Date: Thu, 25 Sep 2014 19:27:33 +0530
> Subject: Returning non-zero exit code in Windows
> To: user@commons.apache.org
> 
> Hi All,
> 
>          I am making use of commons-daemon to get my java process started
> as a Windows Service. I am installing the service and launching it in jvm
> mode. I want to handle any error condition that occurs and I am returning a
> non-zero exit code, and I have set Recovery Options for my service. However
> I am not seeing the service being restarted. I have gone through
> http://comments.gmane.org/gmane.comp.jakarta.commons.issues/19191 and
> http://markmail.org/message/mkavfkirjqb37bqn and I see that this issue was
> fixed long back in 1.0.11.
> 
>          What I am doing is having an UncaughtExceptionHandler for my Java
> runtime and I am handling the same and doing a System.exit(-1). When I run
> my service prunsrv.exe separately from command prompt I am seeing that the
> exit code is -1, but somehow while running as a service, it is not working
> as expected.
> 
>          Can you let me know what I am doing wrong / if I have missed
> anything.
MG>open up DAEMON-306 bug at
MG>https://issues.apache.org/jira/browse/DAEMON-306
MG>and update the report with your bug..be prepared to supply complete 
environment 
MG>jvm version and location
MG>windows version
MG>sc status NameOfProcRunService
MG>as well as all applicable environment variables e.g
PATH
CLASSPATH
and these environment variables as well
set SERVICE_NAME=Daemon-Example

set PR_TEMP=C:/logs
set JAVA_EXECUTION_SERVICE_MODE=0

set INSTALL_FOLDER=C:\DEV\test\my-daemon-example\dist

set JAR_FILE=my-daemon-example-1.0-SNAPSHOT-jar-with-dependencies.jar

set PR_CLASS=com.antonio.castellon.App

set PR_INSTALL=C:\DEV\test\my-daemon-example\dist\prunsrv.exe 
MG>these issues are almost impossible to track down because there are multiple 
variables
MG>involving the JVM, procrun and host environment
MG>the more information you can provide on the application stack you are running
MG>the quicker you will get a solution
MG>Also please provide the source code you are running in the bug report
> 
> -- 
> Thanks & Regards,
> --
> A.Srijith.K.Unni
> Mail ID : srijith.u...@gmail.com
> Home Page : https://about.me/srijith
                                          

Reply via email to