Dynamic Reloading (Hot Deployment) on Glassfish 2.1

This is how I set up dynamic reloading (hot deployment) on Glassfish Application Server v2.1. This is a basic outline of how dynamic reloading works, and some steps may be automated with plugins and scripts.

Set up
 
1. Ensure that dynamic reloading is enabled in the Glassfish Admin Console.
    a. Navigate to Application Server configurations
    b. Check the Enable Reload box
    c. Apply Settings
 
2. Set up the FileSync plugin.
    a. Follow instructions to install here http://andrei.gmxhome.de/filesync/index.html 
    b. Set project properties in Eclipse to map target directory (where built classes are stored) and map it to the appropriate exploded directory in your domain within the Glassfish home directory
 
Procedure
 
1. Modify Java file(s).
 
2. Build Modified Files
    Skip step 3 if the files were built internally within Eclipse.
 
3. Refresh Eclipse files.
    The modified files should now be synchronized with the dynamic deployment directory.

4. Modify or "touch" .reload file.

    An update in the last modified time for the .reload file signals glassfish to dynamically reload the application.
    The server log will show the progress of the application unloading and loading.

5. Test the modified file.

    I tested this by adding log outputs to existing Java files.

   

About these ads

One thought on “Dynamic Reloading (Hot Deployment) on Glassfish 2.1

  1. I am not sure how this is hot deployment if the application unloads and then loads. I have lost my edits or my debugging state if this happens. I am talking about hot deployment in the sense of hot swap. Nothing changes, the app stays up and the class file automatically gets refreshed and I see the new code change. I

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