Using a Deployment Plan

In this OBE tutorial, you will use the weblogic.PlanGenerator command line tool to generate a skeleton JavaEE deployment plan for an existing Web application. After editing the generated plan file, you will use the WebLogic administration console to associate the deployment plan with the application and to redeploy the application.

Approximately 30 minutes

Topics

This OBE tutorial covers the following topics:

Editing a Deployment Plan
Updating an Application with a Deployment Plan

 

Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all screenshots simultaneously, response time may be slow depending on your Internet connection.)

Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.

Overview

A deployment plan is an XML document used to define an application’s deployment configuration for a specific WebLogic Server environment, such as development, test, or production. A deployment plan resides outside of an application’s archive file and contains deployment properties that override an application’s existing JavaEE and 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.

weblogic.PlanGenerator is a Java-based command-line tool intended for developers who want to export portions of a WebLogic Server deployment configuration into a deployment plan file. This utility can generate a brand new plan, or can append to an existing one.

Back to Topic List

System Requirements

Make sure that your system environment meets the following requirements:

Software Requirements

Before starting this tutorial, first complete the following prerequisite tutorials:

Installing and Configuring Oracle WebLogic Server
Configuring Oracle WebLogic Server Managed Instances

Minimum Hardware Requirements

Item Specification
Processor Speed 1 GHz
Memory 1 GB
Free Hard Disk Space 500MB

Back to Topic List

Deploying an Application

Perform the following steps:

1.

Start your administration server and dizzy1 managed server, if not already started. If prompted, enter your domain's administrative username and password.



2.

Download the deploy_plan.zip file that contains the sample Web application and WLST script listed below:

HRApp.war
deploy_HRApp.py

Extract and place both files within the same directory on your local file system. This location will be referred to as <APP_HOME> in later steps.



3.

Open a new command shell. Navigate to the directory <INSTALL_HOME>/wlserver_10.3/server/bin, where <INSTALL_HOME> is the location of your Oracle WebLogic Server installation.


4.

Execute the setWLSEnv script. For example, on Linux, type the following:

source setWLSEnv.sh



5.

Change directories to your <APP_HOME> folder (the location of the downloaded WLST script and sample application).



6.

Execute the deploy_HRApp.py script using WLST:

java weblogic.WLST deploy_HRApp.py

Tip: If your domain's administrative credentials are not admin/welcome1, you will need to first edit this script file and change these values.
Tip: Make sure you have not locked the administration console prior to running this script.

 

7.

Confirm that the application has been deployed to the dizzy1 server. Direct a Web browser to the following URL:

http://localhost:7003/HRApp

 

Back to Topic List

Generating a Deployment Plan for an Application

Perform the following steps:

1.

Return to the same command shell used to run the WLST script. Confirm that the current directory is still <APP_HOME>.

 

2.

Execute the weblogic.PlanGenerator tool on the HRApp.war application:

java weblogic.PlanGenerator -all HRApp.war



3.

You should receive a message similar to the following:

<Saved configuration for application, HRApp.war>

Back to Topic List

Editing a Deployment Plan

Perform the following steps:

1.

Locate the <APP_HOME>/plan.xml file, and open it in a text editor.



2.

Locate the following <variable> element:

<variable>
<name>WeblogicWebApp_ContextRoots_xxxxxxxxxxxxxx</name>
<value xsi:nil="true"></value>
</variable>



3.

Remove the following text from the <value> child element:

xsi:nil="true"

 

4.

Set the value of the <value> child element to /HR:

<value>/HR</value>

 

5.

Futher down in the file, locate the following <variable-assignment> element:

<variable-assignment>
<name>WeblogicWebApp_ContextRoots_xxxxxxxxxxxxxx</name>
<xpath>/weblogic-web-app/context-root</xpath>
</variable-assignment>


6.

Add a new <operation> child element to this <variable-assignment>:

<variable-assignment>
<name>WeblogicWebApp_ContextRoots_xxxxxxxxxxxxxx</name>
<xpath>/weblogic-web-app/context-root</xpath>
<operation>replace</operation>
</variable-assignment>

 

7.

Save your changes.

 

 Back to Topic List

Updating an Application with a Deployment Plan

Perform the following steps:

1.

Launch a Web browser and access your domain's administration console. The default port is 7001:

http://localhost:7001/console



2.

Log into the console using your domain's administrative username and password.

 

3.

In the Change Center panel, click Lock & Edit:

 

 

4.

In the Domain Structure panel, click Deployments:

 


5.

Select the checkbox for the HRApp application, and click the Update button:

 


6.

Click the Change Path button associated with the Deployment Plan Path field :

 



7.

Select the radio button for your new plan.xml file, and click Next. If necessary, use the hyperlinks next to the Current Location field to browse to your <APP_HOME> directory:

 

 

8.

Click the Finish button.



9.

In the Change Center panel, click the Activate Changes button:

 

 

10.

Verify the new context path of the application. Direct your Web browser to the following URL:

http://localhost:7003/HR



 Back to Topic List

In this lesson, you learned how to:

Use weblogic.PlanGenerator to create an initial deployment plan for an existing application

Back to Topic List

Place the cursor over this icon to hide all screenshots.