commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Returning non-zero exit code in Windows
Date Thu, 25 Sep 2014 15:27:32 GMT

> From:
> Date: Thu, 25 Sep 2014 19:27:33 +0530
> Subject: Returning non-zero exit code in Windows
> To:
> 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
> and
> 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>and update the report with your 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
and these environment variables as well
set SERVICE_NAME=Daemon-Example

set PR_TEMP=C:/logs

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 :
> Home Page :
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message