Hello Team,
I am new to apache commons daemons. I am trying to create sample service
before using it in our project.
I have installed service using following command.
*c:\javaservice\amd64>prunsrv.exe //IS//SampleService10
--Install=c:\javaservice\amd64\prunsrv.exe --Jvm=auto --StartMode=jvm
--StartClass=com.bmc.serv*
*ice.Driver --StartParams=start --StopMode=jvm
--StopClass=com.service.Driver --StopParams=stop
--Classpath=C:\Personal\javaService\javaService.jar*
* --DisplayName="SampleServiceJava10"*
Below is the issue when I am trying to execute the service.
c:\javaservice\amd64>prunsrv //ES//SampleService10
*The data area passed to a system call is too small.*
Failed to start service
c:\javaservice\amd64>
Am I doing something wrong over here? I am on windows 7 64 bit machine. I
tried using 32 bit prusrv.exe, and it too failed.
Can you please help me to resolve this issue?
Thanks in advance.
Regards,
Atul.
Driver.java for reference
public class Driver {
private static boolean stop = false;
public static void start(String[] args){
while (stop){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public static void stop(String [] args){
stop = true;
}
public static void main(String[] args) {
String mode = args[0];
switch (mode) {
case "start":
start(args);
break;
case "stop":
stop(args);
break;
}
}
}