users@glassfish.java.net

Re: Running Glass Fish as a Microsoft Server 2005 Service

From: <glassfish_at_javadesktop.org>
Date: Thu, 10 Jan 2008 00:25:20 PST

I'm not a guru on Windows server, but I would think the same method would work on 2005 as I've used on 2003 server.

Assuming the glassfish\bin is in the PATH environment variable, the following should work:

sc.exe create NameOfYourService binPath= "C:\GlassFish\lib\appservService.exe \"asadmin.bat start-domain YourDomain\" \"asadmin.bat stop-domain YourDomain\"" start= auto DisplayName= "GlassFish V2"

If you have placed your glassfish directory structure inside another directory, the parent directory/directories must not include spaces (i.e. like "Program Files"). This will break the command.

//Marius
[Message sent by forum member 'mariusw' (mariusw)]

http://forums.java.net/jive/thread.jspa?messageID=253139