Skip navigation.
Downloads | Product Documentation | Support

Avitek Medical Records Development Tutorials

# Moving to Production

# Tutorial 19: Creating a Deployment Plan and Redeploying the MedRec Package

This tutorial shows how to use the Administration Console to create a deployment plan to store changes to a deployment property of the `medrecEar` application.

A WebLogic Server deployment plan is an optional XML document that resides outside of an application archive and configures an application for deployment to a specific WebLogic Server environment. A deployment plan works by setting deployment property values that would normally be defined in an application's WebLogic Server deployment descriptors, or by overriding property values that are already defined in a WebLogic Server deployment descriptor.

Deployment plans are created and owned by the administrator or deployer for a particular environment, and are stored outside of an application archive or exploded archive directory. As a best practice, BEA recommends storing each deployment plan for a single application in its own plan subdirectory of the application's root directory.

Deployment plans help the administrator easily modify an application's WebLogic Server configuration for deployment into to multiple, differing WebLogic Server environments without modifying the deployment descriptor files included in the application archive. For example, a deployment plan enables you to deploy an application to multiple domains, or to multiple target servers and clusters within the same domain, that have different configurations. To deploy the application to a new environment, an administrator simply creates or uses a new deployment plan as necessary.

The tutorial also shows how to redeploy the MedRec applications to MedRecServer in a production environment. The MedRec applications are contained in the `dist` directory, packaged in four directories in the recommended exploded format. Redeploy an application if you have updated its class files or its generated deployment descriptor files.

The tutorial includes:

- Prerequisites
- Procedure
- Best Practices
- The Big Picture
- Related Reading

# Prerequisites

Before starting this tutorial:

- Work through Tutorial 14: Packaging MedRec for Distribution.
- Work through Tutorial 15: Using WLST and the Administration Console to Deploy the MedRec Package for Production, and have the package currently deployed to `MedRecServer`.

# Procedure

To create and update deployment plans and to redeploy the application:

- Step 1: Update a deployment property and save the new configuration to a deployment plan.
- Step 2: Redeploy the entire application.

## Step 1: Update a deployment property and save the new configuration to a deployment plan.

Use the Administration Console to modify certain deployment properties in applications that are deployed as exploded archive files. When you save the new values for these deployment properties, the Administration Console automatically updates the deployment plan associated with the application, or creates a new one if one does not already exist.

In this procedure, you will change the number of seconds the `patient` Web Application of `medrecEar` remains idle before timing out.

1. Open the Administration Console by navigating in a browser to:

>     http://host:7101/console

where `host` refers to the computer on which MedRecServer is running. If your browser is on the same computer as MedRecServer, then you can use the URL `http://localhost:7101/console`.

2. Specify `weblogic` for both the username and password and click Log In.
3. Click Lock & Edit, located in the upper left Change Center window of the Administration Console.
4. In the left Domain Structure pane, click MedRecDomain—>Deployments.
5. In the Deployments table in the right pane, expand `medrecEar`.
6. Under the Modules section, click the `patient` Web App module.
7. Select the Configuration—>General tab.
8. In the Session Timeout (in seconds) field, enter `3600`.
9. Click Save.
10. In the Save Deployment Plan page, navigate to, and then select, the directory into which you will store the deployment plan.

For example, if you want to store the deployment plan in the same root directory as the production-ready `medrecEar` application is stored, navigate to the `c:\medrec_tutorial\dist` directory and select `medrecEar`.

11. Click Finish.

The Administration Console creates a file called `Plan.xml` in the directory you specified. This XML file contains the deployment plan that is associated with the `medrecEar` application.

12. In the Change Center, click Activate Changes to update the `medrecEar` configuration.
13. To view the new deployment plan:

1. In the left Domain Structure pane, click MedRecDomain—>Deployments.
2. In the Deployments table in the right pane, click `medrecEar`.
3. Select Deployment Plan—>Tuning Parameters.
4. Expand Modules, if it is not already expanded.
5. Click on `patient`.

The Tunable Deployment Plan Variables table lists the property you just updated: `timeoutSecs`.

## Step 2: Redeploy the entire application.

In this procedure it is assumed that MedRec is deployed to a currently running instance of `MedRecServer` and that you have made changes to the application that you want to redeploy. Follow these steps to update a deployed application whose class files or generated deployment descriptor files have changed.

1. In the Administration Console, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
2. In the left Domain Structure pane, click MedRecDomain—>Deployments.

The Deployments table in the right pane displays all deployed applications, which include the `medrecEar`, `physicianEar`, `initEar`, and `startBrowserEar` applications you deployed in Tutorial 15: Using WLST and the Administration Console to Deploy the MedRec Package for Production.

3. In the Deployments table, select the `medrecEar` application by checking the box to the left of its name.
4. Click Update.
5. In the Locate New Deployment Files, click Next without making any changes.

The Locate New Deployment Files pages allows you to specify a completely new source or deployment plan directory if you want to redeploy a new version of the application. For this tutorial, however, redeploy the application using the current files.

6. Review your choices, then click Finish.

If the application has changed since the last time it was deployed, the State column for `medrecEar` in the Deployments table might change from `Active` to `Redeploy Initializing`.

7. In the Change Center, click Activate Changes; the state of the application should change to `Active`.
8. Optionally repeat steps 2 through 7 for each of the remaining applications: `physicianEar`, `initEar`, and `startBrowserEar`.

# Best Practices

Redeploying an application in production is a serious undertaking that can affect performance, so plan application updates carefully. Redeploying an application re-sends the entire application over the network to all of the servers targeted by that Web Application. Increased network traffic may affect network performance when an application is re-sent to the Managed Servers. If the application is currently in production and in use, redeploying causes WebLogic Server to lose all active HTTP sessions.

If you use the Administration Console to update deployment properties of an application, the console automatically creates a deployment plan and associates it with the application (or updates an existing one). A deployment plan is an XML document that defines an application's WebLogic Server deployment configuration for a specific WebLogic Server environment. A deployment plan resides outside of an application's archive file, and can apply changes to deployment properties stored in the application's existing WebLogic Server deployment descriptors. Use deployment plans to easily change an application's WebLogic Server configuration for a specific environment without modifying existing deployment descriptors. Multiple deployment plans can be used to reconfigure a single application for deployment to multiple, differing WebLogic Server environments.

If you have only modified static files, it is probably possible to refresh the files without redeploying the entire application; in this case you would use the weblogic.Deployer utility rather than the Administration Console. See Updating Static Files in a Deployed Application in Deploying Application to WebLogic Server.

# The Big Picture

This tutorial explains how to redeploy an application in production using the Administration Console. You can also use the command-line `weblogic.Deploy` tool to redeploy applications, and to refresh static files in a deployed application.

If you have added modules in your application, redeploying the application deploys the current modules. If you have deleted modules from your application, explicitly remove them from the application domain to remove them from deployment. See Managing Deployed Applications in Deploying Applications and Modules.

# Related Reading

- Update (redeploy) an Enterprise application in the Administration Console Online Help
- Update a Deployment Plan in the Administration Console Online Help
- Understanding WebLogic Deployment
- Updating Applications in a Production Environment