You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "P.N." <pe...@gmx.de> on 2010/12/15 09:49:46 UTC

[procrun] How to start a java service?

Hello!

I'm trying to start a java app as a windows service.

I've installed the app using:

commons-daemon\prunsrv.exe //IS//MyService --DisplayName="My 
Description" --Install=K:\my\path\commons-daemon\prunsrv.exe 
--Classpath=K:\my\path\MyOwnService.jar;K:\my\path\myApp.jar 
--Jvm=C:\path\to\jre\bin\server\jvm.dll --JvmMx=512 
--JvmOptions="-Dmy.option=xyz" --StartMode=jvm 
--StartClass=my.wrapper.MyServiceClass --StartMethod=start 
--StartParams="-a:b;-c:d" --StopMode=jvm 
--StopClass=my.wrapper.MyServiceClass --StopMethod=stop --StdOutput=auto 
--StdError=auto --LogLevel=Debug

Result: Service is installed.

When trying to start my service (from Services console), I'm getting an 
error 3 (Path does not exist). No path is given, and all the paths do 
exist and are changed to be absolute, as You can see above.

When trying to start a service from the command window (using the start 
command from the services properties in the Services console), it fails, 
errors are logged only:

[2010-12-15 09:09:31] [info]  Commons Daemon procrun (1.0.4.0 32-bit) 
started
[2010-12-15 09:09:31] [info]  Running 'MyService' Service...
[2010-12-15 09:09:46] [info]  Run service finished.
[2010-12-15 09:09:46] [error] Commons Daemon procrun failed with exit 
value: 4 (Failed to run service)

Can somebody tell me, what I've done wrong?

Kind regards

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [procrun] How to start a java service?

Posted by "P.N." <pe...@gmx.de>.
Mladen Turk schrieb:
> On 12/15/2010 09:49 AM, P.N. wrote:
>>
>> Hello!
>>
>>  ...
>
> Once when installed you can check the config with
> prunmgr.exe //ES//MyService to see if some params are wrongly set.
>
> Also try running in console mode first.
> prunsrv.exe //TS//MyService
> It should usually give you more info then from service mode.
>
>
>
> Regards

Thank You! Just found out that there're problems to access a net share 
from services.

Kind regards

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [procrun] How to start a java service?

Posted by Mladen Turk <mt...@apache.org>.
On 12/15/2010 09:49 AM, P.N. wrote:
>
> Hello!
>
> I'm trying to start a java app as a windows service.
>
> I've installed the app using:
>
> commons-daemon\prunsrv.exe //IS//MyService --DisplayName="My Description" --Install=K:\my\path\commons-daemon\prunsrv.exe --Classpath=K:\my\path\MyOwnService.jar;K:\my\path\myApp.jar --Jvm=C:\path\to\jre\bin\server\jvm.dll --JvmMx=512
> --JvmOptions="-Dmy.option=xyz" --StartMode=jvm --StartClass=my.wrapper.MyServiceClass --StartMethod=start --StartParams="-a:b;-c:d" --StopMode=jvm --StopClass=my.wrapper.MyServiceClass --StopMethod=stop --StdOutput=auto --StdError=auto --LogLevel=Debug
>
> Result: Service is installed.
>
> When trying to start my service (from Services console), I'm getting an error 3 (Path does not exist). No path is given, and all the paths do exist and are changed to be absolute, as You can see above.
>

Once when installed you can check the config with
prunmgr.exe //ES//MyService to see if some params are wrongly set.

Also try running in console mode first.
prunsrv.exe //TS//MyService
It should usually give you more info then from service mode.



Regards
-- 
^TM

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [procrun] How to start a java service?

Posted by "P.N." <pe...@gmx.de>.
Seems, they've clarified/changed their license, so the community edition 
may not be used combined with commercially sold software. In general, I 
always prefer good maintained OS software (like those from apache) for 
these important issues:
1. It's often more stable.
2. It's lifetime often exceeds that of commercial products.

Kind regards

Peter


Irfan Masood schrieb:
> Try using free community edition of java Wrapper service.
>
> http://wrapper.tanukisoftware.com/doc/english/download.jsp
>
> Regards!
>
> Irfan
>
> On Wed, Dec 15, 2010 at 12:49 PM, P.N.<pe...@gmx.de>  wrote:
>
>>
>> Hello!
>>
>> I'm trying to start a java app as a windows service.
>>
>> I've installed the app using:
>>
>> commons-daemon\prunsrv.exe //IS//MyService --DisplayName="My Description"
>> --Install=K:\my\path\commons-daemon\prunsrv.exe
>> --Classpath=K:\my\path\MyOwnService.jar;K:\my\path\myApp.jar
>> --Jvm=C:\path\to\jre\bin\server\jvm.dll --JvmMx=512
>> --JvmOptions="-Dmy.option=xyz" --StartMode=jvm
>> --StartClass=my.wrapper.MyServiceClass --StartMethod=start
>> --StartParams="-a:b;-c:d" --StopMode=jvm
>> --StopClass=my.wrapper.MyServiceClass --StopMethod=stop --StdOutput=auto
>> --StdError=auto --LogLevel=Debug
>>
>> Result: Service is installed.
>>
>> When trying to start my service (from Services console), I'm getting an
>> error 3 (Path does not exist). No path is given, and all the paths do exist
>> and are changed to be absolute, as You can see above.
>>
>> When trying to start a service from the command window (using the start
>> command from the services properties in the Services console), it fails,
>> errors are logged only:
>>
>> [2010-12-15 09:09:31] [info]  Commons Daemon procrun (1.0.4.0 32-bit)
>> started
>> [2010-12-15 09:09:31] [info]  Running 'MyService' Service...
>> [2010-12-15 09:09:46] [info]  Run service finished.
>> [2010-12-15 09:09:46] [error] Commons Daemon procrun failed with exit
>> value: 4 (Failed to run service)
>>
>> Can somebody tell me, what I've done wrong?
>>
>> Kind regards
>>
>> Peter
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [procrun] How to start a java service?

Posted by Irfan Masood <ir...@gmail.com>.
Try using free community edition of java Wrapper service.

http://wrapper.tanukisoftware.com/doc/english/download.jsp

Regards!

Irfan

On Wed, Dec 15, 2010 at 12:49 PM, P.N. <pe...@gmx.de> wrote:

>
> Hello!
>
> I'm trying to start a java app as a windows service.
>
> I've installed the app using:
>
> commons-daemon\prunsrv.exe //IS//MyService --DisplayName="My Description"
> --Install=K:\my\path\commons-daemon\prunsrv.exe
> --Classpath=K:\my\path\MyOwnService.jar;K:\my\path\myApp.jar
> --Jvm=C:\path\to\jre\bin\server\jvm.dll --JvmMx=512
> --JvmOptions="-Dmy.option=xyz" --StartMode=jvm
> --StartClass=my.wrapper.MyServiceClass --StartMethod=start
> --StartParams="-a:b;-c:d" --StopMode=jvm
> --StopClass=my.wrapper.MyServiceClass --StopMethod=stop --StdOutput=auto
> --StdError=auto --LogLevel=Debug
>
> Result: Service is installed.
>
> When trying to start my service (from Services console), I'm getting an
> error 3 (Path does not exist). No path is given, and all the paths do exist
> and are changed to be absolute, as You can see above.
>
> When trying to start a service from the command window (using the start
> command from the services properties in the Services console), it fails,
> errors are logged only:
>
> [2010-12-15 09:09:31] [info]  Commons Daemon procrun (1.0.4.0 32-bit)
> started
> [2010-12-15 09:09:31] [info]  Running 'MyService' Service...
> [2010-12-15 09:09:46] [info]  Run service finished.
> [2010-12-15 09:09:46] [error] Commons Daemon procrun failed with exit
> value: 4 (Failed to run service)
>
> Can somebody tell me, what I've done wrong?
>
> Kind regards
>
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>