Reputation: 505
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.
Upvotes: 4
Views: 3633
Reputation: 505
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.
Upvotes: 5