I have installed Glassfish v3 on our server, but it seems to close down once in a while and does not start up automatically since it is not installed as a service.
This is the command I try:
C:\Sun\SDK\lib\appservService.exe "C:\glassfishv3\glassfish\bin\asadmin.bat --user admin start-domain domain1" "C:\glassfishv3\glassfish\bin\asadmin.bat stop-domain domain1\"" start=auto
I have tried it with various \ and " added here and there. sc.exe always displays its syntax.
The last I have gotten the following error:
"errorprinter The service process can not connect to the service controller"
As you see my appservService.exe and glassfish are in different directories. This is because I had installed the SDK for glassfish v2 and am trying to reuse it as you see.
Any help would be greatly appreciated.
I think your problem is something very common, you need to leave a space between start= and auto (Example: start= auto)
Here is how I create my services, part of a batch file that creates the Domains.
sc.exe create SunJavaSystemAppDomain1 binPath= "C:\Sun\sdk\lib\appservService.exe \"C:\glassfishv3\glassfish\bin\asadmin.bat start-domain domain1\" \"C:\glassfishv3\glassfish\bin\asadmin.bat stop-domain domain1\ "" start= auto
sc.exe description SunJavaSystemAppDomain1 "Sun Application Server for Domain1"
sc.exe start SunJavaSystemAppDomain1