Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: Deployment Errors
- Next: Tools for Deployment

## The Deployment Life Cycle

After an application is initially deployed, it can be modified and reloaded, redeployed, disabled, re-enabled, and finally undeployed (removed from the server). This section covers the following topics related to the deployment life cycle:

- Dynamic Deployment

- Disabling a Deployed Application or Module

- Dynamic Reloading

- Automatic Deployment

Note –

You can overwrite a previously deployed application by using the `--force` option of `asadmin deploy` or by checking the appropriate box in the Administration Console during deployment. However, you must remove a preconfigured resource before you can update it.

### Dynamic Deployment

You can deploy, redeploy, and undeploy an application or module without restarting the server. This is called dynamic deployment.

Although primarily for developers, dynamic deployment can be used in operational environments to bring new applications and modules online without requiring a server restart. Whenever a redeployment is done, the sessions at that transit time become invalid. The client must restart the session.

### Disabling a Deployed Application or Module

You can disable a deployed application or module without removing it from the server. Disabling an application makes it inaccessible to clients.

To disable an application or module using the `asadmin disable` command, see the Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Reference Manual.

#### To disable an application or module in the Administration Console

1. Open the Applications component.

2. Go to the page for the type of application or module.

   For example, for a web application, go to the Web Applications page.

3. Click on the name of the application or module you wish to disable.

4. Uncheck the Status Enabled box.

##### See Also

For details, see the Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Administration 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. All you have to do is 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 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.

#### To enable dynamic reloading in the Administration Console

1. Select the Application Settings component under the relevant configuration.

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, see the Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Administration Guide.

#### To 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:

       domain-dir/applications/j2ee-apps/app-name/.reload

   For an individually deployed module:

       domain-dir/applications/j2ee-modules/module-name/.reload

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

### Automatic Deployment

Automatic deployment, also called autodeployment, involves copying an application or module file (JAR, WAR, RAR, or EAR) into a special directory, where it is automatically deployed by the Application Server. To undeploy an automatically deployed application or module, simply remove its file from the special autodeployment directory. This is useful in a development environment, because it allows new code to be tested quickly.

Autodeployment is enabled by default.

#### To enable and configure or to disable autodeployment

1. Select the Application Settings component under the relevant configuration.

2. Check the Auto Deploy Enabled box to enable autodeployment, or uncheck this box to disable autodeployment.

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

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

4. You can change the Auto Deploy Directory if you like.

   You can enter an absolute or relative path. A relative path is relative to domain-dir. The default is domain-dir`/autodeploy`.

5. You can check the Verifier Enabled box to verify your deployment descriptor files. This is optional.

   For details about the verifier, see The Deployment Descriptor Verifier.

6. Check the Precompile Enabled box to precompile any JSP files.

##### See Also

For details, see the Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Administration Guide.

- Previous: Deployment Errors
- Next: Tools for Deployment

- © 2010, Oracle Corporation and/or its affiliates