Skip navigation.

Deploying WebLogic Platform Applications

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

Deploying the Application

Once the target environment is set up and the application is prepared for deployment, the final step is to deploy the application to the target environment.

This section describes the following topics:

 


About Deployment Units

A deployment unit refers to a J2EE application (an Enterprise Application or Web Application) or a standalone J2EE module (an EJB or Resource Adapter) that has been organized according to the J2EE specification and can be deployed to WebLogic Server.

For each type of deployment unit, the J2EE specification defines both the required files and their location in the directory structure of the application or module. Deployment units may include Java classes for EJBs and servlets, resource adapters, Web pages and supporting files, XML-formatted deployment descriptors, and even other modules.

J2EE does not specify how a deployment unit is deployed on the target server—only how standard applications and modules are organized. WebLogic Server supports deployments that are packaged either as archive files using the jar utility, or as exploded archive directories.

In certain circumstances, you may need to deploy individual modules within an application to different targets, for example, when deploying a WebLogic Platform application that combines multiple components of WebLogic Platform. Important considerations for targeting these modules and applications are provided in this section.

 


Overview of the Deployment Tools

The following table lists the deployment tools that are available with WebLogic Platform. You can use these tools to deploy, redeploy, undeploy, and distribute applications.

Table 8-1 WebLogic Platform Deployment Tools 

This tool...

Enables you to...

WebLogic Server Administration Console

Perform basic deployment functions interactively using a browser.This method of deployment is convenient if you do not know the exact names of deployment units, target servers, or deployed applications. For more information about deploying applications using the WebLogic Server Administration Console, see Configuring and Managing WebLogic Server.

weblogic.Deployer

Provides a command-line based interface for performing both basic and advanced deployment tasks. Use weblogic.Deployer to automate deployment tasks using shell scripts or batch processes. For more information, see Deployment Tools Reference in Deploying WebLogic Server Applications.

wldeploy

Provides an Ant task version of the weblogic.Deployer utility. Use wldeploy to automate deployment tasks by including commands in an Ant build.xml file and running Ant to execute the commands. For more information, see Deployment Tools Reference in Deploying WebLogic Server Applications.


 

 


Deployment Considerations

The following sections provide considerations for deploying to a production environment, including:

Note: The Customer Support Web site provides general considerations and troubleshooting tips for deploying applications. For more information, see Troubleshooting Deployment Issues at: http://support.bea.com/support_news/product_troubleshooting/Deployment_Pattern.html

Archive Type

You can store an application as a single archive EAR file or as an exploded archive directory. To review considerations, see Deployment Files in Deploying WebLogic Server Applications.

Application Targets

How you target the application depends on the application type:

For more information, see the following sections in Deploying WebLogic Server Applications:

Security Roles

The default Authentication provider delivers two built-in security roles, Admin and Deployer, to enable users to perform deployment tasks using the WebLogic Server Administration Console.

In addition, you may need to create a custom Authentication provider and define additional security roles to further secure the environment. BEA recommends that you create all roles required by an application before deploying it. For more information, see Configuring Security.

Staging Modes

The following table lists the staging modes that define how deployment units are made available to targeted servers. For more details about the staging modes and suggestions on when to use them, see Staging Modes in Deploying WebLogic Server Applications.

Table 8-2 Staging Modes 

Staging Modes

Description

nostage mode

The deployment units are deployed using the same physical copy, which must be accessible by the Administration Server and target servers (for example, via a shared directory). The Administration Server does not copy the deployment unit files to the target servers, in this case. This mode is useful when deploying very large deployments to multiple targets, and for deployments that require dynamic updates. This is the default staging mode for the Administration Server.

stage mode

The Administration Server copies the deployment unit files to the staging directories of target servers and they are deployed using the local copy. This mode is useful when deploying small or moderate size applications, and prevents having a single point of failure if the original copy is not accessible. This is the default staging mode for Managed Servers.

external_stage mode

In external_stage mode you must copy the deployment units manually to the correct staging directories before deployment. Use this staging mode for deployments where you want to manually control the distribution of deployment files to target servers. This mode prevents deployment unit information from being dynamically updated. In this case, the Administration Server accesses the original (master) deployment unit for validation.


 


 

Load Order

The deployment order is determined by the Load Order attribute. By default, each deployment unit is configured with a Load Order value of 100. Deployment units with the same Load Order value are deployed in alphabetical order using the deployment name.

You can change the load order in the WebLogic Server Administration Console or using the ApplicationMBean. For more information, and for a description of configuring the application module and startup class order, see Deployment Order in Deploying WebLogic Server Applications.

Deployment Descriptors

To adjust the run-time deployment configuration without modifying the contents of the application archive, you can use alternate deployment descriptors that are staged externally to the application. You can specify an alternate deployment descriptor file to be used in place of the standard J2EE (application.xml) or WebLogic Server (weblogic-application.xml) deployment descriptor.

For more information, see Deploying Enterprise Applications With Alternate Deployment Descriptors in Deploying WebLogic Server Applications.

 


Steps to Deploy the Application

The following sections describe the steps that are required to deploy applications to the target environment, including:

Note: Before deploying to the target environment, be sure that you have prepared the target environment and the application, as described in the following sections:

Step 1: Start the Servers

Start the Administration Server and Managed Servers, if they are not already running, as described in Starting the Servers.

Step 2: Upload the Application to the Administration Server (Optional)

In order to deploy an application to servers in a domain, the files must be accessible to the Administration Server for the domain. Specifically, they must reside on the Administration Server machine or be accessible via a network mounted directory. For more information, see "Uploading Deployment Files to the Administration Server" in Performing Common Deployment Tasks in Deploying WebLogic Server Applications.

Step 3: Deploy the Application

The procedure that you use to deploy the application depends on the application type. WebLogic Platform and WebLogic Portal applications require a special deployment sequence.

The following sections describe the procedures for deploying an application, based on the application type:

Deploying a WebLogic Integration, WebLogic Server, or WebLogic Workshop Application

Deploy the WebLogic Integration, WebLogic Server, or WebLogic Workshop application to the cluster using one of the deployment tools described in Overview of the Deployment Tools. For targeting and other deployment considerations, see Deployment Considerations.

Deploying a WebLogic Platform or WebLogic Portal Application

Deployment of a WebLogic Portal application or Portal modules of a WebLogic Platform application, is a two-step deployment process. Initially, the WebLogic Portal application or Portal modules must be deployed to a single server and then subsequently deployed to the cluster.

To deploy a WebLogic Platform or WebLogic Portal Application:

  1. Deploy the WebLogic Portal application or Portal modules of a WebLogic Platform application initially to the Administration Server only.
  2. Deploy the WebLogic Portal or WebLogic Platform application to the cluster.
  3. For targeting and other deployment considerations, see Deployment Considerations.

Note: If your cluster is not already running, you can make use of deferred deployment. To initiate deferred deployment, deploy the WebLogic Portal application or Portal modules of a WebLogic Platform application to the Administration Server and the cluster; deploy all other applications and modules to the cluster only. Then, start the Managed Servers, as described in Starting the Managed Servers. At this point, the applications that were deployed to the cluster, are deployed automatically. One advantage of deferred deployment is that the WebLogic Portal application or modules only need to be deployed once.

Step 4: Deploy Event Generators

If your application uses event generators, you must deploy them using the WebLogic Integration Administration Console. For information about deploying event generators, see Creating and Deploying Event Generators in "Event Generators" in Managing WebLogic Integration Solutions.

 


Starting the Servers

You can start the Administration Server and Managed Servers, as described in the following sections:

Before You Start the Servers

Before you start the servers, perform the following tasks:

  1. Set up the Managed Server directories, as described in Setting Up the Managed Server Directories.
  2. If you will be using the Node Manager:
    1. Configure the Node Manager, as described in Configuring Node Manager.
    2. Start the Node Manager on each machine in one of the following ways:
  3. For a WebLogic Platform or WebLogic Portal application, before starting the servers, consider increasing the default memory size to 512 MB, at a minimum. To do so, update all references to the MEM_ARGS variable in the setDomainEnv script in the domain directory, as follows:
  4. If you are using Node Manager to administer Managed Servers, set this variable using the Arguments ServerStart attribute, as described in Configuring the Managed Server Start Attributes.

Starting the Administration Server

To start the Administration Server:

  1. Open a shell (command prompt) on the computer on which you created the domain.
  2. Change to the directory in which you created the domain.
  3. For example: BEA_HOME\user_projects\domains\domain-name, where BEA_HOME specifies the directory where you installed WebLogic Platform 8.1, and domain-name specifies the name of the domain.

  4. Run the available start-up script.
  5. For example:

    Windows: startWebLogic.cmd
    UNIX: startWebLogic.sh

    Note: If you used a Configuration Wizard template that is provided by WebLogic Platform to create the domain, the domain directory includes a start script, typically named startWebLogic.

For more information about starting the Administration Server, see Starting Administration Servers in WebLogic Server Administration Console Online Help.

Starting the Managed Servers

Start the Managed Server in one of the following ways:

 


Example: How to Deploy a WebLogic Integration Application Using weblogic.Deployer and Ant

The following example provides a code excerpt from an Ant build file and demonstrates how to use weblogic.Deployer to deploy a WebLogic Integration application in an automated way to a single-cluster domain, as shown in Single-Cluster Platform Domain Example.

The following sections step you through the process of deploying an application to a target domain.

Define the Properties in the Ant Script

To facilitate automation and reuse of the scripts in different target environments, the code excerpt references properties, such as ${cluster.name}, that are resolved in a properties file imported to the Ant script. For example, the following properties are defined in a separate properties file, myprops.properties:

deploy.dir=deploy
cluster.name=platformcluster
admin.addr=myhost
admin.port=9301
admin.username=username
admin.password=password

The file is referenced in the Ant build file as follows:

<property file="myprops.properties"/>

Define the Main Ant Target

The following defines the main Ant target for the WebLogic Integration application. The target value is shown in bold. The deploy-app target is described below.

  <target name="deploy-IntApp">
<antcall target="deploy-app">
<param name="app.name" value="IntApp" />
<param name="app.src" location="${deploy.dir}/IntApp.ear" />
<param name="app.target" value="${cluster.name}" />
<param name="admin.url" value="http://${admin.addr}:${admin.port}" />
</antcall>
</target>

Define the Deploy Ant Target

The deploy-app target, referenced in the Ant target above, uses the weblogic.Deployer command to deploy the applications, as follows:

<target name="deploy-app">
<java classname="weblogic.Deployer"
fork="true" failonerror="true">
<arg value="-adminurl"/><arg value="${admin.url}"/>
<arg value="-username"/><arg value="${admin.username}"/>
<arg value="-password"/><arg value="${admin.password}"/>
<arg value="-name"/><arg value="${app.name}"/>
<arg value="-source"/><arg value="${app.src}"/>
<arg value="-targets"/><arg value="${app.target}"/>
<arg value="-deploy"/>
</java>

Deploy the WebLogic Integration Application

To deploy the WebLogic Integration application to a single domain, as depicted in Single-Cluster Platform Domain Example:

  1. Start the Administration Server and Managed Servers, as described in Steps to Deploy the Application.
  2. Deploy the WebLogic Integration application using the main Ant target, as follows:
  3. ant deploy-IntApp

 


Example: How to Deploy WebLogic Platform, WebLogic Portal, and WebLogic Integration Applications Using weblogic.Deployer and Ant

The following examples provide code excerpts from an Ant build file and demonstrates how to use weblogic.Deployer to deploy applications in an automated way to a single-cluster domain, as shown in Single-Cluster Platform Domain Example.

Specifically, this example deploys the following three applications to a production environment:

The following sections step you through the process of deploying an application to a target domain.

Define the Properties in the Ant Script

To facilitate automation and reuse of the scripts in different target environments, the code excerpt references properties, such as ${cluster.name}, that are resolved in a properties file imported to the Ant script. For example, the following properties are defined in a separate properties file, myprops.properties:

cluster.name=platformcluster
admin.name=cgServer

The file is referenced in the Ant build file as follows:

<property file="myprops.properties"/>

Define the Ant Targets

As described in Step 3: Deploy the Application, deploying a WebLogic Platform or WebLogic Portal application is a two-step deployment process (unless you use are using deferred deployment):

  1. Deploy the WebLogic Portal application and Portal modules of a WebLogic Platform application initially to the Administration Server only.
  2. Deploy the WebLogic Platform or WebLogic Portal application to the cluster.

For example, the following code excerpt defines the "first" Ant targets, to accomplish step 1 above. Target values are shown in bold. Note that deploy-PlatApp-first uses module-level targeting to target the WebLogic Portal modules of the WebLogic Platform application to the Administration Server only and WebLogic Integration modules to the cluster.

Note: The deploy-app target referenced in the following Ant targets is defined in Define the Deploy Ant Target.

You do not need to define a "first" Ant target for the WebLogic Integration application because it does not require a two-step deployment procedure.

  <target name="deploy-PlatApp-first">
<antcall target="deploy-PlatApp">
<param name="app.target" value="p13n_ejb.jar@${admin.name},PortIntAppDatasync@${admin.name},\
.workshop/PortIntAppWeb/EJB/GenericStateless@${cluster.name},\
.workshop/PortIntAppWeb/EJB/Allocate_1trtqtoxcz4uv@${cluster.name},\
.workshop/PortIntAppWeb/EJB/ProjectBeans@${cluster.name},PortIntAppWeb@${cluster.name}
"
/>
</antcall>
</target>
  <target name="deploy-PortApp-first">
<antcall target="deploy-PortApp">
<param name="app.target" value="${admin.name}"
</antcall>
</target>

The following defines the main Ant targets to accomplish step 2 above. Target values are shown in bold. Note that the WebLogic Portal and WebLogic Platform applications are targeted to the cluster, since they will already have been targeted to the Administration Server via the "first" Ant targets described above.

Note: The main Ant target for the WebLogic Integration application is defined in Define the Main Ant Target.

 <target name="deploy-PlatApp">
<antcall target="deploy-app">
<param name="app.name" value="PlatApp" />
<param name="app.src" location="${deploy.dir}/PortIntApp.ear" />
<param name="app.target" value="${cluster.name}" />
<param name="admin.url" value="http://${admin.addr}:${admin.port}" />
</antcall>
</target>
  <target name="deploy-PortApp">
<antcall target="deploy-app">
<param name="app.name" value="PortApp" />
<param name="app.src" location="${deploy.dir}/PortApp.ear" />
<param name="app.target" value="${cluster.name}" />
<param name="admin.url" value="http://${admin.addr}:${admin.port}" />
</antcall>
</target>

Define the Deploy Ant Targets

Two deployment Ant targets are defined below: 1) One to execute the "first" Ant targets and deploy the WebLogic Portal application and Portal modules of the WebLogic Platform application to the Administration Server only, and 2) The second to deploy the WebLogic Portal, WebLogic Platform, and WebLogic Integration applications to the cluster.

  <target name="deploy-apps-first"
depends="
deploy-PlatApp-first,
deploy-PortApp-first
/>
  <target name="deploy-apps"
depends="
deploy-PlatApp
deploy-PortApp
deploy-IntApp
/>

Deploy the WebLogic Platform, WebLogic Portal, and WebLogic Integration Applications

To deploy the applications to a single domain, as depicted in Single-Cluster Platform Domain Example:

  1. Start the Administration Server and Managed Servers, as described in Steps to Deploy the Application.
  2. Deploy the WebLogic Portal and WebLogic Platform applications initially using the "first" Ant target, as follows:
  3. ant deploy-apps-first
  4. Deploy the applications using the main Ant target, as follows:
  5. ant deploy-apps

 

Skip navigation bar  Back to Top Previous Next