Deploying Applications to WebLogic Server

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Exporting an Application for Deployment to New Environments

The following sections describe how to export an application’s WebLogic Server deployment configuration to a custom deployment plan, which helps administrators easily deploy the application into non-development environments:

 


Overview of the Export Process

Exporting an application’s deployment configuration is the process of creating a custom deployment plan for deploying the application into new WebLogic Server environments. When the process is complete, the application deployment files and the custom deployment plan are distributed to deployers (for example, testing, staging, or production administrators) who then use the deployment plan as a blueprint for configuring the application for their environment.

An administrator can install the application and the custom deployment plan using the Administration Console, which validates the deployment plan and allows the administrator to update configuration properties needed for a specific deployment.

See the Understanding Deployment Plan Contents for more information about deployment plans.

Goals for Exporting a Deployment Configuration

The primary goals in exporting a deployment configuration are:

Tools for Exporting a Deployment Configuration

BEA WebLogic Server provides the following tools to help you export an application’s deployment configuration:

 


Understanding Deployment Property Classifications

Each WebLogic Server deployment descriptor property (for all J2EE module descriptors as well as JDBC, JMS, and WLDF application modules) can be classified into one of the following categories:

Use these categories during the configuration export process to select properties to expose as variables in the deployment plan. For example, a developer can generate a new deployment plan containing variable definitions for all properties tagged as “dependencies” in an application’s WebLogic Server deployment descriptors. The variables can then be easily changed by an administrator deploying the application to an environment having different resource names.

All changeable descriptor properties (dependency, declaration, and configurable properties) are further classified as either dynamic or non-dynamic properties. Dynamic properties can be changed in a deployed application without requiring you to redeploy for the changes to take effect. Non-dynamic properties can be changed but require redeployment for the changes to take effect. The Administration Console identifies non-dynamic properties as a reminder for when redeployment is necessary.

 


Steps for Exporting an Application’s Deployment Configuration

Exporting an application’s deployment configuration typically involves the following procedures:

  1. Staging Application Files for Export
  2. Generating a Template Deployment Plan using weblogic.PlanGenerator
  3. Customizing the Deployment Plan Using the Administration Console
  4. Manually Customizing the Deployment Plan
  5. Validating the Exported Deployment Configuration

The sections that follow describe each procedure in detail.

 


Staging Application Files for Export

BEA recommends placing application files into an application installation directory before exporting the deployment configuration. When using an installation directory, generated configuration files, such as the deployment plan, are automatically copied to the \plan subdirectory during export.

To create an application installation directory:

  1. Create a top-level installation directory for your application:
  2. mkdir c:\exportapps\myApplication
  3. Create \app and \plan subdirectories:
  4. mkdir c:\exportapps\myApplication\app
    mkdir c:\exportapps\myApplication\plan
  5. Copy the complete application to be exported into the \app subdirectory. The application can be either in archive or exploded archive form:
  6. cp -r c:\dev\myApplication c:\exportapps\myApplication\app

    The \app directory must include the full application distribution, and can include the WebLogic Server descriptor files that you use for deployment to your development environment.

If you choose not to use an installation directory when exporting an application, BEA recommends using the -plan option to weblogic.PlanGenerator to specify the location and filename of the generated plan. By default, weblogic.PlanGenerator stores generated files in the TEMP/weblogic-install/application_name/config directory, where TEMP is the temporary directory for your environment. For Windows platforms, this means generated configuration files are stored in C:\Documents and Settings\username\Local Settings\Temp\weblogic\install\myApplication.ear\config. Use the -plan option to place generated files in a known location.

 


Generating a Template Deployment Plan using weblogic.PlanGenerator

The weblogic.PlanGenerator tool provides a quick and easy way to generate a template deployment plan with null variables for an entire category (such as declaration or configurable properties) of deployment descriptors. BEA recommends using weblogic.PlanGenerator to generate a new deployment plan with null variables for all of an application’s dependencies. This ensures that all global resources required for an application can be easily configured by administrators who must deploy the application in a new environment.

When using an application staged in an installation root directory, the basic syntax for using weblogic.PlanGenerator is:

   java weblogic.PlanGenerator -root install_root category

where:

   install_root specifies the fully qualified name of the root directory for the application and plan.

   category specifies the category of WebLogic Server deployment descriptors for which you want to create variables. (See Understanding Deployment Property Classifications for a description of each category.) For the purposes of generating a template deployment plan, you should usually use only the -dependencies option, which is the default option, as this limits variables to external resources required by the application.

Note: The -dependencies option creates null variables for every possible dynamically-configurable deployment property, which can result in a large number of variable definitions that may not be required for your application. The -declarations option is generally not required, because declaration properties are typically associated with the basic functioning of the application and should not be changed before deployment to a new environment.

For example:

   java weblogic.PlanGenerator -root c:\exportapps\myApplication -dependencies
   java weblogic.PlanGenerator -root c:\exportapps\myApplication

With the above commands, which are synonymous because -dependencies is the default option so you are not required to specify it in your weblogic.PlanGenerator command, weblogic.PlanGenerator inspects all J2EE deployment descriptors in the selected application, and creates a deployment plan with null variables for all relevant WebLogic Server deployment properties that configure external resources for the application. Using this template deployment plan, an administrator using the Administration Console is directed to assign valid resource names and tuning properties for each null variable before the application can be deployed.

 


Customizing the Deployment Plan Using the Administration Console

The template deployment plan generated in Generating a Template Deployment Plan using weblogic.PlanGenerator contains only those deployment properties that resolve external dependencies for the application. A developer generally customizes the template plan to add one or more WebLogic Server tuning properties for the application. The Administration Console enables you to easily add deployment plan variables for individual deployment descriptor properties as needed. To customize a deployment plan using the Administration Console:

  1. Install the Exported Application and Template Deployment Plan
  2. Add Variables for Selected Tuning Properties
  3. Retrieve the Customized Deployment Plan

Install the Exported Application and Template Deployment Plan

To modify a deployment configuration using the Administration Console, you must first install the application and existing deployment plan as described in Steps for Creating an Application Installation Directory.

Add Variables for Selected Tuning Properties

After installing the exported application, follow the steps in Update a deployment plan in Administration Console Online Help to add new tuning properties to the deployment plan.

Retrieve the Customized Deployment Plan

When you modify an application’s deployment configuration using the Administration Console, your changes to deployment properties are stored in a WebLogic Server deployment plan and/or in generated WebLogic Server deployment descriptor files. If you modify any deployment properties defined as variables in the application’s deployment plan, your changes are written back to a new version of the plan file. If the application that was installed from an installation directory, the Administration Console stores the generated configuration files in the plan subdirectory by default.

 


Manually Customizing the Deployment Plan

In some cases you may need to edit a custom deployment plan manually, using a text editor. This may be necessary for the following reasons:

Note: You cannot use the Administration Console to remove variable definitions from the deployment plan or assign a null value for a deployment property.

See http://www.bea.com/ns/weblogic/90/weblogic-deployment-plan.xsd and Understanding Deployment Plan Contents before manually editing deployment plan entries.

Removing Variables from a Deployment Plan

The variable-definition stanza in a deployment plan defines the names and values of variables used for overriding WebLogic Server deployment descriptor properties. The module-override element may contain one or more variable-assignment elements that define where a variable is applied to a given deployment descriptor. To remove a variable from a deployment plan, use a text editor to delete:

Assigning Null Variables to Require Administrator Input

To assign a null value to an existing variable definition, simply change any text value that is present in the value subelement in the variable element to <value xsi:nil="true"></value> where the xsi namespace is defined as: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance". For example, change:

...
  <variable-definition>
    <variable>
      <name>SessionDescriptor_InvalidationIntervalSecs_11029744771850</name>
      <value>80</value>
    </variable>
  </variable-definition>
...

to:

...
  <variable-definition>
    <variable>
      <name>SessionDescriptor_InvalidationIntervalSecs_11029744771850</name>
      <value xsi:nil="true"></value>
    </variable>
  </variable-definition>
...

 


Validating the Exported Deployment Configuration

The Administration Console automatically validates the deployment configuration for a newly-installed application or module. To validate a custom deployment plan that you have created during the export process:

  1. Follow the steps under Add Variables for Selected Tuning Properties to install the application or module with the final version of the custom deployment plan. The Administration Console automatically uses a deployment plan named plan.xml in the plan subdirectory of an installation directory, if one is available.
  2. On the Summary of Deployments page, select the name of the application or module that you installed.
  3. Select the Deployment Plan > Dependencies tab.
  4. Verify that the dependencies configured for the deployed module are valid for the selected target servers.

 


Best Practices for Exporting a Deployment Configuration

Keep in mind these best practices when exporting an application’s deployment configuration:


  Back to Top       Previous  Next