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

Configuring Applications for Production Deployment

The following sections describe how you configure applications for deployment to a production WebLogic Server environment:


Understanding the Deployment Configuration Process

When an administrator or deployer receives a new application, or a new version of an application, from development or quality assurance teams, the application is usually configured for a development or testing environment. The application may use specific resource names and performance tuning settings that match the available resources on the target servers used in the development or QA environments where the application was last deployed.

Because development and testing environments can be significantly different from the production environment in which the application is ultimately deployed, an Administrator must configure the application to use resource names and performance tuning parameters that are valid and appropriate for the production environment.

Deployment Configuration Lifecycle

Deployment configuration for an application can occur at several points in the lifecycle of an application. Each phase of deployment configuration typically involves creating and working with different deployment files:

  1. Development configuration—During development, a programmer creates J2EE deployment descriptors for an application or module. The programmer also creates WebLogic Server deployment descriptors to configure the application for deployment to a Weblogic Server development environment. See Developing Applications with WebLogic Server.
  2. Note: Applications developed outside of the WebLogic Server development environment (for example, a sample or third-party J2EE application such as PetStore) may include only J2EE descriptors.
  3. Export configuration—Before releasing an application from development, a programmer or designer may optionally export the application’s deployment configuration to a WebLogic Server deployment plan. Exporting a configuration creates deployment plan variables for all or a subset of the deployment properties already defined by a developer in the application’s WebLogic Server deployment descriptor files. See Exporting an Application for Deployment to New Environments.
  4. Exporting an application helps deployers in other areas of the organization (such as engineers on the QA team or production Administrators) easily deploy the application to environments that differ from the programmer’s development environment. The ideal deployment plan includes all of the properties that a deployer needs to change before deploying the application in a new environment.

  5. Deployment-time configuration—An Administrator or deployer configures the application before deploying the application into the target environment. Deployment-time configuration may use:
    • The same Weblogic Server deployment configuration and deployment plan created during development
    • Modified versions of the development configuration and deployment plan
    • A custom deployment plan that the deployer previously created for the environment, depending on the deployment configuration workflow for your organization.
    • See Deploying Applications and Modules with weblogic.deployer.

  6. Post-deployment configuration—After an application has been deployed to a target environment, an Administrator or deployer can reconfigure the application by redeploying with a new deployment plan or by using the Administration Console to update and redeploy an existing deployment plan. See Redeploying Applications in a Production Environment and Managing Deployed Applications.

Because deployment configuration is performed by different people at different points in the lifecycle of an application, administrators, deployers, and developers need to work together to create a repeatable configuration workflow for their organization. See Typical Deployment Configuration Workflows.

Understanding Application Deployment Descriptors

The basic deployment configuration for an application is defined in multiple XML documents, known as deployment descriptors, that are included as part of the application archive file that you receive for deployment. Deployment descriptor files fall into two separate categories:

For the purposes of a production deployment, you should treat both the J2EE and WebLogic Server deployment descriptors as part of the application’s source code, which is owned by your development team. Do not edit application deployment descriptors in order to configure an application for deployment to a production environment. Instead, persist configuration changes into a WebLogic Server deployment plan, which is described in the next section.

Understanding WebLogic Server Deployment Plans

As previously discussed, a WebLogic Server deployment plan is an optional XML document that you use to configure an application for deployment to a specific WebLogic Server environment. A deployment plan specifies setting deployment property values that would normally be defined in an application’s WebLogic Server deployment descriptors, or overrides property values that are already defined in a WebLogic Server deployment descriptor. When exporting an application, the deployment plan typically acts to override selected properties in the WebLogic Server deployment descriptors you created during development.

Typically, deployment plans are created by developers along with the associated application files, then distributed to the Administrator or another deployer, who updates the plan for a particular environment (such as staging, testing, or production). The deployment plan is stored outside of an application archive or exploded archive directory. As a best practice, Oracle recommends storing each deployment plan for a single application in its own plan subdirectory of the application’s root directory (See Creating an Application Installation Directory).

Deployment plans help the Administrator easily modify an application’s WebLogic Server configuration for deployment to multiple, differing WebLogic Server environments without modifying the deployment descriptor files included in the application archive. Configuration changes are applied by adding or changing variables in the deployment plan, which define both the location of the WebLogic Server descriptor properties to change and the value to assign to those properties. Administrators deploying an application need only change the deployment plan—the original deployment files and deployment descriptors remain unchanged as shown in Figure 4-1. To determine the deployment configuration workflow for your environment, see Typical Deployment Configuration Workflows.

Figure 4-1 WebLogic Server Deployment Plan

WebLogic Server Deployment Plan

Goals for Production Deployment Configuration

For the Administrator, the primary goal of configuring an application for production deployment is to generate a new deployment plan that is valid and appropriate for the target WebLogic Server environment. Specifically, the deployment plan must resolve all external resources references for the application to refer to valid resources available in the target environment. If the Application’s configuration does not define to valid external resources for the target servers, the application cannot be deployed.

A deployment plan can optionally define or override WebLogic Server tuning parameters, to make ideal use of resources in the target environment. Defining tuning parameters is not required in order to successfully deploy an application. If an application’s deployment descriptors and deployment plan do not define tuning parameters, WebLogic Server uses default values.


Typical Deployment Configuration Workflows

Deployment plans enable you to define a convenient, repeatable workflow for configuring an application for deployment to multiple WebLogic Server environments. A configuration workflow for production applications requires cooperation between your development and design teams, which create and package the deployable application, and the administrator or deployer for each target WebLogic Server environment.

The ideal deployment configuration workflow for your organization is determined by:

The sections that follow describe common deployment configuration workflows for managing deployment plans and deploying applications to multiple WebLogic Server domains.

Caution: Oracle does not support using a deployment plan to change the context-root in an application.xml file. However, if an application is deployed as a library, you can either change the context-root through an weblogic-application.xml file or use the deployment plan to change the context-root in an weblogic-application.xml file.

Application with Single Deployment Plan

Organizations that know the exact configuration of different deployment environments can use a single, well-defined deployment plan to deploy an application to multiple WebLogic Server domains. The single deployment plan configuration workflow works in the following way:

  1. The development team, cooperating with administrators and deployers, creates a master deployment plan for use with all target environments. The number of target environments will vary depending on your organizational structure. Common deployment environments include one or more Quality Assurance (QA) or testing domains, staging domains, and production domains.
  2. The deployment plan that the team creates at this phase defines variables for all configuration properties that are known to differ between each target environment. For example, the plan might define empty variables for resource names that differ between environments and must be configured before the application can be deployed. The plan may also define default values for common tuning parameters that deployers may want to change in their environments.

    For more information about creating a deployment plan during development, see Exporting an Application for Deployment to New Environments.

  3. When a version of the application is ready to be released, the development team packages the application deployment files and delivers both the deployment files and a master deployment plan to deployers for each target environment.
  4. Each deployer uses the Administration Console to install the application and identify the deployment plan to use for configuration. The Administration Console validates the overall deployment configuration based on the resources available in the target domain. The Console then presents a list of configurable properties defined in the plan (as well as any invalid properties) to the deployer for editing.
  5. Figure 4-2 Single Deployment Plan Workflow

    Single Deployment Plan Workflow

  6. The deployer uses the Administration Console to interactively configure properties that were defined in the deployment plan. Deployment plan variables that have null values, or invalid values for the target WebLogic Server instances or clusters, must be configured before the application can be deployed. Deployment plan variables that already have valid values need not be changed before deployment.
  7. Deployers in each environment agree to limit their configuration changes to those properties defined in the deployment plan. If additional configuration changes are required, the deployer must communicate those requirements to the development or design team that modifies the master deployment plan.

    Benefits of a Single Deployment Plan Workflow

Using the single deployment plan workflow provides the following benefits:

In general, you would use a single deployment plan workflow if your organization has a few, well-understood target environments, and you want to easily replicate a standardized deployment configuration in each environment.

Single Deployment Plan Ownership and Limitations

The single deployment plan workflow assumes that the development or design team maintains ownership of the deployment plan, and that deployers limit their plan changes to those variables defined in the plan. If the deployer modifies only those properties defined in the deployment plan, their changes are written back to the same deployment plan as updates to the variables.

However, WebLogic Server imposes no restrictions on the configuration properties that a deployer can modify using the Administration Console. If a deployer configures deployment properties that were not originally defined in a plan, the Console generates a new deployment plan having the additional variable entries, and uses the new plan for deployment or redeployment operations. This can lead to a situation where the deployer uses a deployment plan that is drastically different from the master deployment plan owned by the development team.

To incorporate new changes into the master deployment plan, the deployer retrieves the new, customized deployment plan created by the Console. Ideally, those changes should be applied to the master deployment plan.

Application with Multiple Deployment Plans

Organizations that have numerous deployment environments that frequently change should use a configuration workflow with multiple deployment plans. In a multiple deployment plan workflow, each deployment plan is owned by the deployer of the application rather than the development team. The multiple deployment plan configuration workflow works in the following way:

  1. The development team releases a version of the packaged application deployment files (containing J2EE and Weblogic Server descriptors). The development team may or may not include a template deployment plan with exported variables for resource definitions or common tunable parameters.
  2. Before deploying the application, each deployer generates a custom deployment plan to configure the application for their target environment.
  3. A custom deployment plan can be created by starting with a template deployment plan (or no deployment plan) and making changes to the application’s deployment configuration using the Administration Console. See Update a deployment plan in Administration Console Online Help.

  4. After defining the deployment configuration for their environment, each deployer retrieves their custom deployment plan and maintains it for future deployments of the application. Oracle recommends storing custom configuration plans in a source control system so that new versions can be tracked and reverted to if necessary.
  5. Figure 4-3 Multiple Deployment Plan Workflow

    Multiple Deployment Plan Workflow

  6. For subsequent releases of the application, each deployer uses their customized deployment plan to configure the application for deployment. Using the customized plan allows deployers to perform deployments with the weblogic.Deployer or automate deployments using WLST.

Benefits of a Multiple Deployment Plan Workflow

Using the multiple deployment plan workflow provides the following benefits:

In general, you would use a multiple deployment plan workflow if your organization has many deployment environments that change frequently, making it difficult or impossible to maintain a single master deployment plan.

Multiple Deployment Plan Ownership and Limitations

The multiple deployment plan workflow assumes that the deployer or administrator (rather than the programming or design team) owns and maintains the deployment configuration for an application. It also assumes that the basic J2EE configuration of the application rarely changes, because certain J2EE configuration changes would render a deployer’s custom configuration plans invalid. For example, if a module in an Enterprise Application is added, removed, or changed, custom deployment plans referencing the module would become invalid. In this case, each deployer would need to re-create a custom plan by configuring the application using the Administration Console.


Creating a New Deployment Plan to Configure an Application

The Administration Console automatically generates (or updates) a valid XML deployment plan for an application when you interactively change deployment properties for an application that you have installed to the domain. You can use the generated deployment plan to configure the application in subsequent deployments, or you can generate new versions of the deployment plan by repeatedly editing and saving deployment properties.


Generating a deployment plan using the Administration Console involves these steps:

  1. Preparing the Deployment Files
  2. Installing the Application Archive
  3. Saving Configuration Changes to a Deployment Plan

The sections that follow use the WebLogic Server sample application jspExpressionEar.ear to describe each step.

Preparing the Deployment Files

Use the following the directions to prepare your application for deployment.

  1. Create a new root directory and app and plan subdirectories for your application. For example:
  2. mkdir c:\sample_root
    mkdir c:\sample_root\app
    mkdir c:\sample_root\plan
  3. Download the WebLogic Server sample application jspExpressionEar.ear from Be sure to save the application to the c:\sample_root\app directory you created in Step 1.

Installing the Application Archive

The Administration Console uses an application installation assistant to help you install a new application for configuration and deployment to a new WebLogic Server environment. After you install an application or module and select deployment targets, the deployment files are available in the WebLogic Server domain and can be configured, distributed, and deployed as necessary.

Follow these steps to install the sample application to the examples server domain:

  1. Start the examples server WebLogic server by using the Windows start menu or by running the WL_HOME\samples\domains\wl_server\startWebLogic.cmd script.
  2. Access the Administration Console by pointing your browser to http://localhost:7001/console.
  3. Log in to the Administration Console.
  4. Follow the steps in Install applications and modules in Administration Console Online Help to install your application or the jspExpressionEar.ear sample application you downloaded in Preparing the Deployment Files.

Saving Configuration Changes to a Deployment Plan

Use the Administration Console to edit deployment configuration properties for the application you installed in Installing the Application Archive and save the configuration to a deployment plan. For example, you could change properties such as the following in the jspExpressionEar.ear sample application:

  1. On the Configuration page, edit one or more configuration properties. For example, change the Session Invalidation Interval to 80 seconds, and the Session Timeout to 8000 seconds.
  2. Click Save to save your changes. The Administration Console stores your configuration changes to a new deployment plan. If you deployed the sample application from a root directory, the Administration Console automatically places the new deployment plan in the \plan subdirectory of the root directory. For example, c:\sample_root\plan\Plan.xml.


Understanding Deployment Plan Contents

The deployment plan generated in Creating a New Deployment Plan to Configure an Application contains the entries shown in Sample Deployment Plan.

Listing 4-1 Sample Deployment Plan
<deployment-plan xmlns="">
    <variable>       <name>SessionDescriptor_InvalidationIntervalSecs_11029744771850</name>
    <module-descriptor external="false">
    <module-descriptor external="false">
    <module-descriptor external="false">
    <module-descriptor external="false">
    <module-descriptor external="false">
    <module-descriptor external="false">

The basic elements in the deployment plan serve the following functions:

For more information about the contents of a WebLogic Server deployment plan, see


Using an Existing Deployment Plan to Configure an Application

Applications that you receive for deployment may come with varying levels of configuration information. If you have an existing deployment plan for an application, simply prepare the application as described in Preparing the Deployment Files and place the deployment plan in the plan subdirectory of the application root. Then install the application using the instructions in Installing the Application Archive. The Administration Console automatically uses a deployment plan named plan.xml in the \plan subdirectory of an application root directory if one is available. If multiple plans are available for your application, they are placed in their own \plan subdirectories (for example \plan1 and \plan2), and the Administration Console cannot identify them. Therefore, the config.xml must specify the plan you want to use. For information on config.xml, see Domain Configuration Files in Understanding Domain Configuration.

After you install a new application and existing deployment plan, the Administration Console validates the deployment plan configuration against the target servers and clusters that were selected during installation. If the deployment plan contains empty (null) variables, or if any values configured in the deployment plan are not valid for the target server instances, you must override the deployment plan before you can deploy the application. You can also configure tuning parameters to better suit the target environment in which you are deploying the application, as described in Saving Configuration Changes to a Deployment Plan. Changes you make to the application’s configuration are saved to a new deployment plan.

If you have a valid deployment plan that fully configures an application for the environment in which you are deploying, you can use either the Administration Console or the weblogic.Deployer utility to deploy an application with a deployment plan to use for deployment.

Note: Any deployment plan you use with the weblogic.Deployer utility must be complete and valid for your target servers. weblogic.PlanGenerator does not allow you to set or override individual deployment properties when it creates a plan. To deploy a new application and existing deployment plan using weblogic.Deployer, see Deploying an Application with a Deployment Plan.


Generic File Loading Overrides

This feature allows you to place application-specific files to be overridden into a new optional subdirectory (named /AppFileOverrides) in the existing plan directory structure. The presence or absence of this new optional subdirectory controls whether file overrides are enabled for the deployment. If this subdirectory is present, an internal ClassFinder is added to the front of the application and module ClassLoaders for the deployment. As a result, the file override hierarchy rules follow the existing ClassLoader and resource loading rules and behaviors for applications. For more information on WLS application classloading, see WebLogic Server Application Classloading in Developing Applications with WebLogic Server.

Note: This mechanism is only for overriding resources and does not override classes.

These are application-specific files and the contents are opaque to WLS, so the entire file contents will be overridden when an override file is supplied.

How It Works

The files placed in the /AppFileOverrides subdirectory are staged and distributed along with the rest of the plan directory contents and are available on all of the targets. Applications are then able to load these files as resources using the current ClassLoader (for example, using the ClassLoader.getResourceAsStream method.) This either finds the overridden files or the files packaged in the application, depending on the configuration and whether overridden files are supplied.

For web applications, application file overrides only apply to the classpath related resources (which are in WEB-INF/classes and WEB-INF/lib), and do not apply to the resource path for the web application. Therefore, overrides are seen by web applications using the classloader.getResourceAsStream() method to lookup resources, but overrides do not affect web application calls to the ServletContext.getResourceAsStream() method.

In order to use this feature, you must:

Directory Structure

The contents of the /AppFileOverrides subdirectory use the existing plan directory structure and directory naming conventions that already exist for descriptor overrides. For more information on directory naming conventions, see Packaging Files for Deployment.

Enabling application file overrides causes a directory ClassFinder to be added to the application and module level ClassLoaders, which point to the appropriate root directories within the /AppFileOverrides subdirectory (which is in the plan directory). The ClassFinder inserted into the front of the application’s ClassLoader is given a structure of AppDeploymentMBean.getLocalPlanDir + separator + "/AppFileOverrides". The ClassFinder inserted into the front of the module’s ClassLoaders is given a structure of AppDeploymentMBean.getLocalPlanDir + separator + "/AppFileOverrides" + separator + moduleURI.

For Example:

Table 4-1 Directory Structure for Generic File Overrides
Directory put in front of the main application classloader’s classpath
Directory put in front of the WebApp1.war classloader’s classpath
Directory put in front of the WebApp2.war classloader’s classpath

Application Usage

It is important to note that the application controls the file contents and format and controls whether the contents of the files are accessed by the application code. As a best practice, generic file loading overrides should be used by application code that has environment-specific properties files, and which is loading those properties files as resources using the application’s classloader. For example, the application code may do the following:

Properties myAppProps = new Properties();
InputStream iostream =


Additional Configuration Tasks

See the following sections for information about additional deployment configuration tasks:


Best Practices for Managing Application Configuration

  Back to Top       Previous  Next