I can install, uninstall and run my service as a console application using the Apache Commons Daemon tool. The problem is when I try to run my application as a service, the service status doesn't switch from stopped to running.
Script used to install the service:
prunsrv.exe install ServiceName --DisplayName="Some Display Name" --Classpath %cd%\daemon.jar --Install=prunsrv.exe --Jvm=auto --StartMode=jvm --StopMode=jvm --StartClass=Main --StartParams start --StopClass=Main --StopParams stop
I'm running the service in windows 8 - 64bits.
Any ideas of what could be the problem?
EDIT: When running the application in the services.msc and I get the following message:
Windows could not start the [Service Name] service on Local Computer
Error 2: The system cannot find the file specified.
EDIT2: Tryed in Windows 7-64bits. Same problem.
The problem was that windows could not find the prunsrv.exe file. In the install folder it must be specified the full path to the executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With