Thursday, October 30, 2008

How to Install a Glassfish Patch

Recently I've been working quite extensively with glassfish and had a need to apply a patch for some of the core code.

To my big surprise I was not able to find the official way to apply patches to a glassfish installation. I found several patches posted on the issue tracker and paying customers have access to tested and supported patch bundles, which are released outside of the regular release cycle. But even some extensive googling didn't easily reveal how to apply them.

Then luckily I found this discussion on the glassfish mailing list, which describes the process.

To make life easier for others and google to index this information, here is a brief recap:
  1. Create a directory <glassfishroot>/lib/patches
  2. Copy the jar with your patch into this directory
  3. Edit your <glassfishroot>/domain/<domainname>/config/domain.xml and add attribute classpath-prefix="${com.sun.aas.installRoot}/lib/patches/<patchname.jar>" to the <java-config ...> node
  4. Restart your domain
I tested this with Glassfish v2, I'll have to check if it works with the upcoming v3 as well.


Anonymous said...

This really helped me out when I tried to figure out how to patch Glassfish !! THANKS! // ola

Anonymous said...

Nice! Simple and sweet. Thanks!!!