C2B2 logo icon

Glassfish 4 - Migrating to Glassfish

This is the fourth and final blog in our series of looking at Glassfish 4. The Previous posts are available here:

Part 1 - Getting Started
Part 2 - Features for High Availablity
Part 3 - Performance tuning, Monitoring and Troubleshooting

In this blog we are going to be looking at 2 areas:

1) Migrating from previous versions of Glassfish to Glassfish 4
2) Migrating from another application server to Glassfish

Just to recollect a few points from our previous posts, Glassfish is an open-source application server by Oracle. It was originally from Sun Micro-systems. It is a reference implementation for Java EE, in other words this could be the first place where you get to try out the new features of a new Java EE release. Oracle also has a commercial version of this app server called Oracle Glassfish server for those who need extra support and quick bug-fixes.

Glassfish 4 is the reference implementation of Java EE 7.

Migrating from previous versions of Glassfish to Glassfish 4

In this section we are going to discuss some of the tools that are available for migration and its uses.


For those who wish to upgrade from a previous installation of the glassfish server to the current version there are two upgrade paths to choose from:



a) Side-by-Side Upgrade


             As the name suggests, this path involves running two installations, i.e. the old server installation and the new version running side by side. The new Glassfish server release is installed in a different directory than the release from which you are upgrading from. This gives you the ability to switch back and forth and test the installation completely before switching to the new release.


b) In-place Upgrade


             In contrast to the side by side upgrade, the in-place upgrade path install the new version over and into the same directory as the existing version. Performing an in-place upgrade is easier than performing a side-by-side upgrade, however you lose the ability to switch back and forth and also there is no way to revert back an in-place upgrade to a previous version. Due to these limitations In-place upgrade is usually limited to non-production environments.


Note: itis only possible to perform an in-place upgrade when upgrading from GlassfishServer 3.1.1, 3.1, 3.0.1, or v3. If you are upgrading from product versionsprior to 3x, you must perform a side-by-side upgrade.




Tools for Upgrade



Oracle provides us with some tools in order to perform this migration/upgrade


1) Upgrade Tool


           This tool is used for performing side by side upgrades. It migrates the configuration and deployed applications from an earlier version to the current version. This tool can be used either as a graphical Wizard or in command line mode.
This is the only tool available for upgrading from versions prior to 3.0.1.


2) Update Tool & pkg Utility


             This tool is used to perform an in-place upgrade of the entire glassfish server.
Update tool is the graphical interface and the pkg utility is the command line counterpart.


3) Software Update Notifier


             This tool is very similar to the update tool and pkg utility. It is distributed as a configuration option during installation. Once enables it monitors the installation and gives pop up notifications when updates or upgrades are available.


Supported Releases


Below is the list of releases that are supported for a upgrade to Glassfish Server 4


Sun GlassFishEnterprise Server v2.1.1


SunGlassFishEnterprise Server v3
GlassFishServerOpen Source Edition 3.0.1
GlassFishServerOpen Source Edition 3.1
GlassFishServerOpen Source Edition 3.1.1
         If you are currently running a release that is not supported, you would have a perform to 2 step upgrade to get to the current release. First upgrade to a release that is supported ( listed above) and then to the latest version (4).

Migrating from another application server to Glassfish

In this section we are going to look at a very high level at some of the things you might consider while moving to a new application server and how glassfish performs in these areas and how it compares to other modern application servers.


1) Download and Installation


Free Download. Reasonable size ( approx 98 mb ). Bigger than Tomcat and Jetty but much smaller than Weblogic or Websphere. Comparable in size to the latest Jboss download. Quick and easy to install. You can use either the graphical interface or just download and unzip the archive.


2) Configuration and Deployment


Everything needed to manage and maintain a Glassfish server is put into the asadmin utility. It has got a lot of sub commands but need to go through the documentation to familiarize yourself with those commands. Also possible to configure things using the domain.xml file.
It supports single deployment i.e. you could deploy your application from one place to clusters or multiple servers. It also supports multiple application versions.
Comparable to all other mordern app servers.


3) Tools Integration/Support

Excellent Tooling support. Has plugins for all major IDE s (Netbeans, Eclipse, IntelliJ). Also has plug-in for Maven and ANT.




4) Documentation

Good documentation provided for an open source product ( as compared to say JBoss where documentation is not their strong point). Active forums and mailing lists also available.





5) Performance



When it comes to performance Glassfish does a pretty good job. It has got reasonable start up times ( in the region of a few seconds ) as opposed to weblogic whose start-up times are in the region of a couple of minutes. It has a modular design, as in it doesn't load all the sub-components at start-up. It loads them as and when your application uses it. Glassfish supports High availability with both clustering and load balancing features.


6) Administration


Glassfish supports administration through its asadmin utility and its web based console. Provides a rich set of management and configuration functionality
Asadmin is a powerful non-GUI mode utility that allows you to configure both local and remote servers and the web console provides a non complicated browser based approach. 
Glassfish stands out when it comes to  administration features when compared to JBoss or Tomcat.


7) Cost


Last but not least, the cost. GlassFish server is dual licensed under CDDL and GPL v2. Its free to run in both development and production. Oracle also has a commercial version of this app server called Oracle Glassfish server.

C2B2 provide expert GlassFish support services 24/7 to customers running mission critical GlassFish applications. Our GlassFish engineers provide 2nd and 3rd line expertise as backup to your GlassFish operations team. For more information please visit our support page


That brings us to the end of this blog.


For a more detailed description on the topic discussed on this blog you can watch our webinar video: