Computing @ 40's

Trying to overcome the obsolescence

Installing Glassfish 3.1.2.2 and upgrading EclipseLink 2.4.0

This is the first technical post in this blog.

Maybe it will be too simple for experienced audience, but one of the most frustrating things you can live if you work with computers is that even the installation of a product or software fails, and installing Glassfish at its current version has some tricks I wanted to comment. And maybe, if you are starting just now, it can help you.

If you want to install a Glassfish server in a production environment follow these steps. For a development environement maybe is better to use another method that I explain in this post.

The objective will be:

  1. Install Glassfish 3.1.2.2: I will install on a Windows 7 64 bit Virtual Machine (see Development Environment).
  2. Update EclipseLink to version 2.4.0: I will update EclipseLink coming with Glassfish (2.3.3) with the latest version (2.4.0), released in June 2012.

Install Glassfish 3.1.2.2

I assume you have already the installation file that you can get at http://glassfish.java.net/downloads/3.1.2.2-final.html. Because this is a Windows installation I prefer to choose the Windows Installer in its full platform multilingual installation (glassfish-3.1.2.2-windows-ml.exe).
I also assume that you have you Java SDK installed (jre) installed. In my case I am using JDK 7 u5.

The first trick comes even to execute the installation file. Because it’s a 64 bit installation the installer can’t find the Java Runtime environment. It will show you a message like this:

At least the message is clear. So you need to execute the installer from the command line, with a sentence like this, assuming you have the installer on the desktop:


cd C:\Users\Dani\Desktop
glassfish-3.1.2.2-windows-ml.exe -j "C:\Program Files\Java\jre7"

You will get a wizard-style installation. After passing the first presentation screen of this wizard you will be asked to choose the installation type between “Typical” or “Custom” installation. In the past I have had some troubles with Custom installation, but now the main problem comes with the Typical installation. So we will choose Custom installation and we will follow these wizard steps:

  • Install and Configure
  • Select default installation folder (c:\glassfish3) or change it as you wish.
  • Select the JDK you want to use as Java Runtime for Glassfish. Generally it detects the Java version you have installed.
  • On the next screen it gives you the opportunity to install and enable Update tool. I don’t recommend to install nor enable it if you are in a production environment, especially because I have read some articles referring to several troubles with the update tool. By now we will choose to not to install it.
  • Finally push Install button to start installation.

The installation is fast. After finishing we will follow these steps to create a domain:

  • Choose option “Create a server domain”
  • Configure the server domain: you have to choose a name, admin and http ports, and username and password for admin user. Because this is a development installation we will not create a service for the server and we will not start the domain after finishing the installation (uncheck both check boxes at the end of this screen)

After choosing configuration parameters, press Next and you will have your domain installed and configured. The domain will not be started if you choose to not to start it, so we can start it from Eclipse, for example.

What happens if I wanted a Typical installation ?

The answer is: you will have a problem when creating the domain in the last step of the wizard installation. The problem comes because the installer doesn’t know the path to JDK. You have to do a trick after the installation of Glassfish but before creating the domain as shown before.

When arriving to the step of domain configuration (domain name, admin name and password, etc…) go to C:\glassfish3\glassfish\config and edit file asenv.bat At the end of the file specify the JDK folder that you have changing line AS_JAVA. For example:

set AS_JAVA=C:\Program Files\Java\jdk1.7

After that continue the installation and it will work. As you see it’s really bizarre to do this with an installer.

Last step: updating EclipseLink to the last version (2.4)

This step is not really necessary. Glassfish 3.1.2.2 comes with EclipseLink 2.3.3 as default JPA provider. But EclipseLink 2.4 introduces several nice features at Java Persistence Query Language Extensions that I am using right now at work and makes my live easier. And I want to include this version with my installation of Glassfish.

These steps have worked for me, although I’m not sure if it’s the best way to achieve this.

  • Download Eclipselink 2.4 OSGi bundles from EclipseLink site and unzip file somewhere on your disk
  • Assuming you installed Glassfish at C:\Glassfish3, go to C:\Glassfish3\glassfish and make a backup copy of folder modules (C:\Glassfish3\glassfish\modules).
  • Delete all jar files in modules folder beginning with org.eclipse.persistence (org.eclipse.persistence.*.jar)
  • Copy to folder modules all jars from the downloaded and unzipped file beginning with org.eclipse.persistence but not containing source (you probably don’t need it). In this case I have copied these files. Maybe not all are necessary for your purposes.

org.eclipse.persistence.antlr_3.2.0.v201206041011.jar
org.eclipse.persistence.asm_3.3.1.v201206041142.jar
org.eclipse.persistence.core_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.dbws.builder_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.dbws_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.jpa.equinox.weaving_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.jpa.equinox_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.jpa.jpql_2.0.0.v20120608-r11652.jar
org.eclipse.persistence.jpa.modelgen_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.jpa.osgi_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.jpars_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.jpa_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.moxy_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.nosql_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.oracle.nosql_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.oracleddlparser_1.0.0.v20120530.jar
org.eclipse.persistence.oracle_2.4.0.v20120608-r11652.jar
org.eclipse.persistence.sdo_2.4.0.v20120608-r11652.jar

  • If you have started at least once the server before you will need to delete the content of Felix cache folder inside your domain’s folder. For example assuning you have a domain called MainDomain you will have to delete contents of folder C:\glassfish3\glassfish\domains\MainDomain\osgi-cache\felix

After that you can start Glassfish! Good luck !

Update 06/09/2012: I have just realized that last step (deleting content of folder C:\glassfish3\glassfish\osgi\felix) was wrong. I have updated this post to correct this. You have to delete the contents of felix chache folder inside your domain folder

Cardedeu, July, 30 2012.

2 thoughts on “Installing Glassfish 3.1.2.2 and upgrading EclipseLink 2.4.0

  1. On Linux, Glassfish 3.1.2.2 comes with EclipseLink 2.3.2 at installation (and not EclipseLink 2.3.3). I didn’t check for installation on Windows.

  2. thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 43 other followers