users@glassfish.java.net

Real world Glassfish 3.1 deployment on Windows

From: <glassfish_at_javadesktop.org>
Date: Tue, 14 Sep 2010 12:41:07 PDT

This is getting out of hand so I thought I'd put a thread and a list together to describe how to do this.

1. Download Glassfish 3.1b19 or later.
2. Set a GLASSFISH_HOME environment variable.
2.5 :-) Set a JAVA_HOME environment variable.
3. Make sure %GLASSFISH_HOME%\glassfish\bin is in your path.
4. To make absolutely sure that the about-to-be-installed Glassfish will pick up the right Java, edit the %GLASSFISH_HOME%\glassfish\config\asenv.bat file and append:

AS_JAVA=%JAVA_HOME%

...to it. Otherwise the asadmin command will just use "java" as the command, and even if you THINK you have it in your path, chances are the service user does not. I installed a large .ear file only to be told that Glassfish needed a full JDK, not a JRE. Of course there isn't a JRE in the path, so I'm not sure what it was picking up.

5. Run asadmin create-service.
6. It will fail. Go to %GLASSFISH_HOME%\glassfish\domains\domain1\bin and edit the .xml file you see there so that its "id" element contains a legal Windows service identifier (i.e. no slashes).
7. Run the .exe you see there with an argument of "install".

I hope this helps the Glassfish team see what needs to be made pain free for a very typical installation scenario (stock, unmodified Glassfish running as a service out of the box using all defaults).

Best,
Laird
[Message sent by forum member 'ljnelson']

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