Sun GlassFish Enterprise Server 2.1 Application Deployment Guide

Dynamic Reloading

If dynamic reloading is enabled (it is by default), you do not have to redeploy an application or module when you change its code or deployment descriptors. Simply copy the changed JSP or class files into the deployment directory for the application or module. The server checks for changes periodically and redeploys the application, automatically and dynamically, with the changes. This feature is available only on the default server instance. Deployment directories are as follows:

For an application:


For an individually deployed module:


Dynamic reloading is useful in a development environment, because it allows code changes to be tested quickly. In a production environment, however, dynamic reloading might degrade performance. In addition, whenever a reload is done, the sessions at that transit time become invalid. The client must restart the session.

You can also use the sun-appserv-update task with the asant utility to update an application or module. See Chapter 3, The asant Utility, in Sun GlassFish Enterprise Server 2.1 Developer’s Guide.

ProcedureTo Enable Dynamic Reloading in the Admin Console

  1. To access reloading features:

    • In the developer profile:

      1. Select the Application Server component.

      2. Select the Advanced tab.

      3. Select the Applications Configuration tab.

    • In the cluster profile:

      1. Select the Stand-Alone Instances component.

      2. Select the instance named server in the table.

        This is the Admin Server.

      3. Select the Advanced tab.

  2. Check the Reload Enabled box to enable dynamic reloading.

  3. Enter a number of seconds in the Reload Poll Interval field.

    This sets the interval at which applications and modules are checked for code changes and dynamically reloaded. The default is 2.

See Also

For details, click the Help button in the Admin Console.

ProcedureTo Reload Code or Deployment Descriptor Changes

  1. Create an empty file named .reload at the root of the deployed application or module.

    For an application:


    For an individually deployed module:

  2. Explicitly update the .reload file’s timestamp (touch .reload in UNIX) each time you make changes.