Release Notes - GlassFish Server 4


Overview - GlassFish 4

This Release Note covers all point releases for GlassFish 4 that are offered by eApps. Upgrade instructions are included.

eApps recommends, as a best practice, to maintain a staging server where you can test software upgrades before moving them into production. This approach will allow you to minimize the risk of data loss and downtime of your production service when performing software upgrades. If necessary, you can rebuild your staging Virtual Server on demand so that you have a fresh installation to test on. If you need more information about setting up a Virtual Server for staging or testing, please contact eApps Sales.

IMPORTANT: GlassFish 4 has an extensive list of new features and changes, and is the first application server to support Java EE 7 and this release has introduced significant new functionality to GlassFish. See the official GlassFish 4 Release Notes for a list of changes that may cause issues when upgrading: GlassFish 4 Release Notes. Please read this document carefully to understand all the changes in GlassFish 4. Upgrading to this version may significantly impact the operation of your database and applications. All GlassFish 4 documentation is located here: GlassFish 4 Documentation

Before upgrading to GlassFish 4, please carefully read and review the official documentation related to this release. Failure to read, review, and test before upgrading may result in data loss and downtime for your customers.

eApps Release Notes for GlassFish 4.1
eApps Release Notes for GlassFish 4.0

How to upgrade
GlassFish 3 to GlassFish 4 (ISPmanager 4 only)
GlassFish 4.x to GlassFish 4.y (newer version)


Highlighted Features and Fixes in GlassFish 4.1

Features

  • Java SE 7 1.7.0_65 or higher, or Java SE 8 1.8.0_20 or higher are required
  • Java API for RESTful Web Services
  • Java API for JSON Processing

Fixes

  • Enterprise Java Beans (EJB) updated to version 3.2
  • Java Servlets updated to 3.1
  • Java Server Pages (JSP) updated to 2.3

The official Release Notes for GlassFish 4.1 are available here (please note that this is a PDF file) https://glassfish.java.net/docs/4.1/release-notes.pdf


Highlighted Features in GlassFish 4.0

Features

  • Java EE 7 Application Support
  • Java API for JSON Processing (JSON-P) 1.0
  • Updated Enterprise Java Beans (EJB) 3.2

The official Release Notes for GlassFish 4.0 are available here (please note that this is a PDF file) - https://glassfish.java.net/docs/4.0/release-notes.pdf


How to upgrade

The method you choose to upgrade GlassFish depends on which version of GlassFish you are currently on:

  1. If you are on version 3 and wish to upgrade to the latest (version 4.1) you will need to upgrade to version 4.0 by uninstalling version 3 and installing version 4, and then using the pkg tool to update to version 4.1.

  2. If you are on version 4.0 and wish to update to version 4.1, you will use the pkg tool to update to the latest version.

You will need to be able to connect to your Virtual Server using SSH and work from the command line as the root user.

It is also advised that you back up your existing GlassFish applications and configurations before starting the upgrade process. These files are usually in the /opt/glassfishv3 or /opt/glassfishv4 directories. If you do not have current backups of your applications and configurations and something goes wrong during the upgrade or update process you could have data loss and downtime.

Before upgrading GlassFish make a backup of your database. Follow the instructions for your database: MySQL, MariaDB, or PostgreSQL.

GlassFish 3 to GlassFish 4 (ISPmanager 4 only)

Because GlassFish 4 is a major release, you cannot upgrade your existing GlassFish 3 installation in place. You will need to:

  1. Stop GlassFish 3
  2. Backup your existing /opt/glassfishv3 directory
  3. Remove GlassFish 3
  4. ISPmanager 4 Specific Instructions
  5. Install GlassFish 4
  6. Redeploy your existing applications from the /opt/glassfishv3 directory to the new GlassFish server

There are some additional steps that are specific to ISPmanager that are covered in that section.

You will need to work from the command line as the root user to uninstall GlassFish 3. After you remove GlassFish, you will install it from the ISPmanager Control Panel.

Before beginning the upgrade process, make a backup of your databases and your existing GlassFish applications and configurations. See the How to upgrade section for more information if necessary.

To upgrade GlassFish in ISPmanager, connect to the Virtual Machine using SSH. Do the following as the root user.


1. Stop GlassFish 3

Stop the glassfish service with the /etc/init.d/glassfish stop command.

[root@eapps-example ~]# /etc/init.d/glassfish stop

It may take a minute or so for the glassfish service to stop.

  1. Backup your existing /opt/glassfishv3 directory

Use the mv /opt/glassfishv3 /opt/glassfishv3.orig command to move your existing glassfishv3 directory to a backup location. This maintains your existing files and configurations. If you skip this step you may have data loss.

[root@eapps-example ~]# mv /opt/glassfishv3 /opt/glassfishv3.orig

  1. Remove GlassFish 3

Remove GlassFish 3 with the yum remove glassfishv3 command. Remember, if you did not move the /opt/glassfishv3 directory to /opt/glassfishv3.orig you may have data loss after removing GlassFish.

[root@eapps-example ~]# yum remove glassfishv3

  1. ISPmanager Specific Instructions

For ISPmanager 4 only, several commands have to be run to remove the existing GlassFish 3 configuration from the Control Panel so that the correct version will show after the new version is installed.

Copy and paste these commands into your terminal window so that they are entered correctly. Enter one command at a time, run that command, and then go on to the next one.

sed -i.glassfish_v3_backup '/glassfishv3/,+6d' /usr/local/ispmgr/etc/ispmgr.conf
/usr/local/ispmgr/sbin/mgrctl -m ispmgr plugin.update elid="appins" sok=ok >/dev/null 2>&1
/usr/local/ispmgr/sbin/mgrctl -m ispmgr feature.packcache elid="" sok=ok >/dev/null 2>&1

[root@eapps-example ~]# sed -i.glassfish_v3_backup '/glassfishv3/,+6d' /usr/local/ispmgr/etc/ispmgr.conf
[root@eapps-example ~]# /usr/local/ispmgr/sbin/mgrctl -m ispmgr plugin.update elid="appins" sok=ok >/dev/null 2>&1
[root@eapps-example ~]# /usr/local/ispmgr/sbin/mgrctl -m ispmgr feature.packcache elid="" sok=ok >/dev/null 2>&1

  1. Install GlassFish 4

ISPmanager 4 - go to Server Settings > Applications. GlassFish 4 will be available to install. Note that the default password for the GlassFish Admin Console is shown in this screen.

ISPmanager 5 - go to Settings > Features, and install GlassFish 4.

  1. Redeploy your applications

Once GlassFish 4 has been installed, you will need to redeploy your applications from the /opt/glassfishv3.orig directory.

GlassFish 4.x to 4.y (newer version)

In order to update to GlassFish 4.1 (or any newer version in the 4.x branch) you will already need to be on GlassFish 4. If you are on GlassFish 3 and ISPmanager 4, please see the upgrade instructions here first - GlassFish 3 to GlassFish 4 (ISPmanager 4 only).

The update from GlassFish 4.0 to 4.1 uses the pkg tool, which is a command-line tool built into GlassFish. You will need to set up the pkg tool and the needed repositories, stop your GlassFish domain(s), run the pkg update, and then start your GlassFish domain(s).

Before beginning the update process, make a backup of your databases and your existing GlassFish applications and configurations. See the How to upgrade section for more information if necessary.

Here are the steps to update GlassFish 4.0 to GlassFish 4.1:

  1. Install the required 32 bit compatibility dependencies
  2. Verify that you can log in to the GlassFish Admin Console and that your GlassFish applications are running
  3. Update the pkg tool and repository
  4. Run the pkg list command to verify that the pkg tool works
  5. Stop your GlassFish domain(s)
  6. Run the pkg image-update command to update GlassFish to the latest version of the stable branch
  7. Start your GlassFish domain(s)
  8. Update the RPM database to show the correct version of GlassFish
  9. Log in to the GlassFish Admin Console and verify that your GlassFish applications are running

1. Install the required 32 bit compatibility dependencies

If you are running a 64 bit Virtual Machine/Virtual Server (the majority of eApps customers are on a 64 bit OS), you will need to install several dependencies in order for the pkg tool to run. These dependencies are installed from the command line of the Virtual Server, using yum. The dependencies required are: zlib.i686, libstdc++.i686, glibc.i686, libidn.i686, krb5-libs.i686. Install them with the yum install -y zlib.i686 libstdc++.i686 glibc.i686 libidn.i686 krb5-libs.i686 command.

[root@eapps-example ~]# yum install -y zlib.i686 libstdc++.i686 glibc.i686 libidn.i686 krb5-libs.i686

2. Verify that you can log in to the GlassFish Admin Console and that your GlassFish applications are running

Verify that you can successfully log in to the GlassFish Admin Console, located at http://eapps-example.com:4848 or http://IP_Address:4848 (substitute your own domain name for eapps-example.com). In the GlassFish Admin Console, note the current version of GlassFish.

If you have forgotten the password for the GlassFish Admin Console, please contact eApps Support for assistance. Also verify that your GlassFish applications are running as expected.

3. Update the pkg tool and repository

By default the pkg tool is not set to executable, and the repository where it will need to download the GlassFish update from is not enabled. You will need to set the tool to be executable with the chmod +x pkg command, and then run the ./pkg list (dot slash pkg <space> list) command. When prompted to install the software, answer y.

[root@eapps-example ~]# cd /opt/glassfish4/bin
[root@eapps-example ~]# chmod +x pkg
[root@eapps-example ~]# ./pkg list

The software needed for this command (pkg) is not installed.

When this tool interacts with package repositories, some system information
such as your system's IP address and operating system type and version
is sent to the repository server. For more information please see:

http://wikis.oracle.com/display/updatecenter/UsageMetricsUC2

Once installation is complete you may re-run this command.

Would you like to install this software now (y/n): y

Proxy: Using system proxy settings.
Install image: /opt/glassfish4
Installing pkg packages.
Downloading 4 packages.
Downloading pkg-toolkit-incorporation (2 files, 71,742 bytes).
File 2/2
Downloading pkg (511 files, 6,237,953 bytes).
File 511/511
Downloading pkg-java (42 files, 670,981 bytes).
File 42/42
Downloading python2.4-minimal (304 files, 6,873,977 bytes).
File 304/304
Executing 2 removal actions.
Executing 45 update actions.
Executing 941 install actions.
Initialization complete.

Software successfully installed. You may now re-run this command (pkg).

4. Run the pkg list command to verify that the pkg tool works

Once you have set up the pkg tool, run the ./pkg list command again to make sure that the tool is working correctly.

[root@eapps-example ~]# ./pkg list
NAME (PUBLISHER) VERSION STATE UFIX
felix 4.0.2-0 installed u---
glassfish-appclient 4.0-89 installed u---
glassfish-cluster 4.0-89 installed u---
glassfish-cmp 4.0-89 installed u---
glassfish-common 4.0-89 installed u---
glassfish-common-full 4.0-89 installed u---
glassfish-common-web 4.0-89 installed u---
glassfish-corba 4.0.0-4 installed u---
glassfish-corba-base 4.0.0-4 installed u---
~
~
~
[output truncated]

5. Stop your GlassFish domain(s)

Before doing the update, stop your GlassFish domain(s). NOTE - you are NOT stopping the glassfish service, you are stopping the application server part of GlassFish.

To do this, you will need to become the gfish user and use the asadmin stop-domain domain1 command. If you have multiple domains in GlassFish you will need to stop them separately. Once you have stopped your GlassFish domains, exit from the gfish user to return to the root user.

[root@eapps-example bin]# su - gfish
-bash-4.1$ asadmin stop-domain domain1
Waiting for the domain to stop .
Command stop-domain executed successfully.
-bash-4.1$ exit

6. Run the pkg image-update command to update GlassFish to the latest version of the stable branch

Once the GlassFish domain(s) are stopped, you can run the pkg image-update command to update GlassFish to the latest version of the stable branch.

[root@eapps-example bin]# ./pkg image-update
Download: glassfish-web-incorporation ... Done
Download: glassfish-full-incorporation ... Done
Download: glassfish-jmx ... Done
Download: javadb-core ... Done
Download: glassfish-entitybeans-container ... Done
Download: glassfish-osgi ... Done
Download: felix ... Done
Download: jersey ... Done
Download: glassfish-corba ... Done
~
~
~ [output truncated]
Removal Phase ... Done
Install Phase ... Done
Update Phase ... Done

7. Start your GlassFish domain(s)

Once the update process is complete, switch back to the gfish user and start your GlassFish domain(s) with the asadmin start-domain domain1 command. If you have multiple domains, you will need to start them separately.

[root@eapps-example bin]# su - gfish
-bash-4.1$ asadmin start-domain domain1
Waiting for domain1 to start ..................
Successfully started the domain : domain1
domain Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

8. Update the RPM database to show the correct version of GlassFish

After the GlassFish update is complete, you will need to update the system RPM database to show the correct version of GlassFish. This is a long command that needs to be on one line. The best suggestion is to copy and paste this command into a plain text editor (Notepad or TextEdit), and then into your command prompt.

mkdir /tmp/glassfish4_pkg; yum install -y yum-utils; yumdownloader --destdir=/tmp/glassfish4_pkg glassfish4; rpm -Uvh --justdb /tmp/glassfish4_pkg/glassfish4*; rm -rf /tmp/glassfish4_pkg

[root@eapps-example ~]# mkdir /tmp/glassfish4_pkg; yum install -y yum-utils; yumdownloader --destdir=/tmp/glassfish4_pkg glassfish4; rpm -Uvh --justdb /tmp/glassfish4_pkg/glassfish4*; rm -rf /tmp/glassfish4_pkg

9. Log in to the GlassFish Admin Console and verify that your GlassFish applications are running

Once the GlassFish domain(s) are running, log back in to the GlassFish Admin Console using your existing username and password. Note that the GlassFish version should be updated, and your GlassFish applications should now be running.


Comments

Please login to comment