Jul 092010
 

It’s only a few days since I’ve posted my Eclipse / GlassFish / Java EE 6 Tutorial, but due to the fact that it took me so long to write it, the toolset that I used is already outdated.

In the meantime Oracle has published a bugfix release to GlassFish v3, their reference implementation of Java EE 6 (and still the only implementation available), and of course Eclipse 3.6, code name “Helios”, has arrived. The last two days I had a deeper look into the combination, and I can tell that it works :)

Overall Impressions

Some bugs have been fixed, for example it is no problem now to restart the server, and the bug with libraries having been added to an EAR’s lib directory being “forgotten”, is gone as well.

At the moment I see only one major annoyance, and that is that re-publishing an application to the server tends to fail. The workaround is, to not manually re-publish, but instead use Add and Remove from the server’s context menu, Remove the application, Finish, followed by Add and Remove / Add / Finish. The bug has been reported on Java.net, but so far the guys responsible for the GlassFish plugin claim, that it is a bug in Eclipse. I fully expect some ping pong between the two development teams until the bug gets fixed :D

At work, under Linux, I have played once through my whole tutorial and found no showstopper. Thus, when I begin to teach Java EE 6 from next week, this is the combination that I’ll use.

Software versions and installation

I have used the following software versions:

  • JDK 6 Update 21 (JDK!!!): There are 32 bit and 64 bit versions, under Linux I have used the 32 bit version, on my laptop, where I’m just writing this, I run the 64 bit version. No problem with either.
  • Java EE 6 SDK: There is only one version, but the SDK is mostly JARs anyway. This time there is no “GlassFish Tools Bundle for Eclipse”, so be sure to download the right package. On the download page is a matrix that shows, which packages include what version. You will want the full Java EE 6 SDK, not the “Web Profile”.
  • Eclipse IDE for Java EE Developers is available for 32 bit and 64 bit as well. Under Linux I have used 32 bits, under Windows 7 the 64 bit version.
  • The Aquarium blog lists a temporary Eclipse update site for the GlassFish plugin, that’s how I have installed it. In the long run, the GlassFish plugin will be merged into the Oracle Enterprise Pack for Eclipse, the plugin that covers Oracle’s commercial application servers.

First thing to install is the JDK. Under Windows I have installed it to the default location. The JDK installs a JRE (runtime only) as well.

When you install the Java EE 6 SDK, you are asked to choose the JDK to be used. Unfortunately the stupid updatetool installation still has not been fixed. The installer asks you if it should be installed and you really ought to do that. Included with the installer is only a bootstrap version. Unfortunately (and unlike the full version) the bootstrap version can’t easily cope with authenticating proxies. At work under Linux, I had to supply username/password as part of the http_proxy environment variable, and because our proxy needs a Windows domain name in front of the user name, with a backslash as separator, I was in quoting hell :)

What I did after installing to ~/Applications/GlassFish_v3.01 was this:

cd ~/Applications/GlassFish_v3.01/bin
sh
http_proxy='http://DOMAIN\\\\USER:PASSWORD@PROXYSERVER:PROXYPORT' ./updatetool
http_proxy='http://DOMAIN\\\\USER:PASSWORD@PROXYSERVER:PROXYPORT' ./updatetool
^D

Starting sh disables the commandline history. Passwords don’t belong into histories :)

The first call to updatetool actually calls the bootstrap tool, the second call is to the real thing, a GUI tool, and there I’ve installed the two updates that are currently available, and then I have disabled automatic updates.

The four backslashes are necessary, because the bootstrap tool is a shell script, and the value is obviously evaluated two times. Whatever.

This was only a problem under Linux, because our fabulous proxy understands NTLM, and the Windows machine at work where I tried it, automatically authenticated via NTLM.

After the Java EE 6 SDK is installed (and with it GlassFish v3.01), don’t start the server. In your develpoment environment you will want to start it from Eclipse.

Next thing to install is Eclipse Helios. Simply unpack the ZIP where you want it. Start Eclipse, go to the Workbench, use Window > Preferences > Install/Update > Available Software Sites > Add to add the location http://download.java.net/glassfish/eclipse/helios, for instance under the name GlassFish Plugin.

Close the Preferences dialog and use Help > Install New Software. Make sure that Group items by category is not checked, at the top under Work with select the site you’ve just added, and now you should see three entries in the list, Oracle GlassFish Server Tools and the documentations for Java EE 5 and Java EE 6. Install all three. After the installation, Eclipse will prompt you to restart the application. Do so, and after marveling at the changed intro screen, go to the Workbench again.

Now we need to make sure, that we use the right JDK. Use Window > Preferences > Java > Installed JREs and check, that the path really points to the JDK that you’ve just installed, and not to the JRE, that was installed along with it.

Finally you can go to the Servers view and from its context menu add a server. As server type choose GlassFish Server Open Source Edition 3 (Java EE 6). Supply the directory, where you’ve installed the server (actually the glassfish directory within the directory, where you’ve instaleld the Java EE 6 SDK).

From then on, you can start the server via Eclipse and follow the tutorial.

Within the next days I will adapt the tutorial to the new versions and remove the discussion of bugs that have been fixed, but I will keep the old version for those people, who can’t update yet.

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>