Recently I wanted to check out the GlassFish application server (version 2) together with Eclipse (version 3.3 or Europa) and encountered some problems. Here is my minimalist conclusion:
- Download the latest version of GlassFish, in my case it was 2ur2-b04.
- Read the documentation, there is more to do than just unpack the archive and start it.
- Do it! Go there! Read it!
java -Xmx256m -jar glassfish-installer-v2ur2-b04-windows.jaris obvious...
- Now comes an important part: Probably you do not want GlassFish to live in the
/glassfish-folder, I would rather have it in something like
/glassfish-2ur2-b04for this version. So
- Copy and/or rename the newly created and filled directory
glassfishto your liking. This has to be done before you continue! You can't do that later.
- Go into this folder and execute
lib\ant\bin\ant -f setup.xmlas shown in the GlassFish documentation. This should finish the installation.
- To create a new server in Eclipse JEE perspective, use the "New Server" wizard in the "Server" tab. But where is GlassFish?
- So click on the "Download additional server..." link
- When working behind a proxy, this may take long and not list GlassFish in the end. The reason is that an https-Proxy has to be configured in Eclipse.
- Now you are able to create the new server. If the wizard tells you that it can't find some
appserv-rt.jar, then you forgot to call
ant -f setup.xmlduring installation of GlassFish (as listed above).
- This is because GlassFish comes with it's jars in the pack200 format, which do not end with
.jar.pack.gzand are unpacked during installation. (Manually unpacking
unpack200 lib\appserv-rt.jar.pack.gz lib\appserv-rt.jardoes not help here. You need to call the set-up...)
- Start the server. If you get error messages that the system can't find some path and the start-up fails with a timeout after a minute then you did not move/rename the
/glassfish-folder to the desired destination before calling the setup.
- This is because GlassFish has his scripts like
asadmin.batcontain absolute paths written during setup, e.g.
- Enjoy the finally starting GlassFish, serving it's index page at port 8080:
Now is it GlassFish 2.2 or Sun's Application Server 9.1? ;-)