Deploying WebLogic Server Applications
The following sections describe tools for deploying applications and standalone modules to WebLogic Server:
The weblogic.Deployer utility replaces the earlier weblogic.deploy utility, which has been deprecated. The weblogic.Deployer utility is a Java-based deployment tool that provides a command-line interface to the WebLogic Server Deployment Management API on page 5-11. This utility was developed for administrators and developers who need to initiate deployment from the command line, a shell script, or any automated environment other than Java.
To use the weblogic.Deployer utility:
% java weblogic.Deployer [options] [actions] [file(s)]
You can also list specific files in the archive that are to be deployed (or redeployed, or undeployed). The file list can include file names and directories relative to the root of the application. If you specify a directory, its entire subtree is deployed or redeployed.
The following table lists weblogic.Deployer options.
Note: The activate
and deactivate
actions have been deprecated. Use deploy
or start
instead of activate
. Use undeploy
or stop
instead of deactivate
.
Table 5-1 weblogic.Deployer Options
The URL of the Administration Server. Default is |
|
The Administrator username. If you supply the |
|
The password of the Administrator user. To avoid having the plain text password appear in scripts or in process utilities such as If you want to use a specific configuration file and key file, rather than the default files, use the |
|
Specifies the deployment name for the application or standalone module. This can be the name of an existing, configured application or the name to use when creating a new configuration. |
|
A comma-separated list of the target servers and/or cluster names (<server1>,<cluster1>,...). Each target may be qualified with a J2EE module name (<module1> For an application that is currently deployed, |
|
Used after the
|
|
Specifies the location of a user configuration file to use for the administrative username and password. Use this option, instead of the |
|
Specifies the location of a user key file to use for encrypting and decrypting the username and password information stored in a user configuration file (the |
|
Displays additional progress messages, including details about the prepare and activate phases of the deployment. |
|
Specify either |
|
Prints command-line help text for the most commonly-used |
|
Prints full command-line help text for all |
|
Transfers the specified source file(s) to the Administration Server. Use this option when you are on a different machine from the Administration Server and you cannot copy the deployment files by other means. The application files are uploaded to the WebLogic Server Administration Server's upload directory prior to deployment. |
|
Indicates that |
|
Does not copy the deployment files to target servers; instead, deploys them from the fixed location specified using the
|
|
Copies deployment files to target servers' staging directories before deployment. stage is used as the default when deploying to Managed Server targets. |
|
Does not copy the deployment files to target servers; instead, you must ensure that deployment files have been copied to the correct subdirectory in the target servers' staging directories before deployment. You can manually copy the files or use a third-party tool or script. |
|
|
|
Specifies the maximum time, in seconds, to wait for the deployment task to complete. After the time expires, |
|
Specifies the location of the archive file or exploded archive directory to deploy. |
|
Specifies the name of an alternate J2EE deployment descriptor ( |
|
Specifies the name of an alternate WebLogic Server deployment descriptor ( |
|
Specifies the task identifier of a running deployment task. You can specify an identifier with the |
|
Table 5-2 weblogic.Deployer Actions
The wldeploy
Ant task enables you to perform weblogic.Deployer
functions using attributes specified in an Ant XML file. You can use wldeploy
along with other WebLogic Server Ant tasks to create a single Ant build script that:
wlcompile
, appc
, and the Web Services Ant tasks.wlserver
and wlconfig
Ant tasks.wldeploy
Ant task.See Using Ant Tasks to Configure a WebLogic Server Domain in the WebLogic Server Command Reference for more information about wlserver
and wlconfig
. See Programming Topics in Developing WebLogic Server Applications for information about wlcompile
.
On Windows NT, execute the setWLSEnv.cmd
command, located in the directory WL_HOME\server\bin
, where WL_HOME
is the top-level directory of your WebLogic Server installation.
On UNIX, execute the setWLSEnv.sh
command, located in the directory WL_HOME/server/bin
, where WL_HOME
is the top-level directory of your WebLogic Server installation.
build.xml
by default). If you want to use an Ant installation that is different from the one installed with WebLogic Server, start by defining the wldeploy
Ant task definition:<taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy"/>
wlserver
and wlconfig
tasks in the build script to create and start a new WebLogic Server domain. See Using Ant Tasks to Configure a WebLogic Server Domain in the WebLogic Server Command Reference for information about wlserver
and wlconfig
.wldeploy
to deploy your application to one or more WebLogic Server instances or clusters. See Sample build.xml Files for wldeploy and wldeploy Ant Task Reference.build.xml
file by typing ant
in the staging directory, optionally passing the command a target argument:prompt> ant
The following sample shows a wldeploy
target that deploys an application to a single WebLogic Server instance:
<target name="deploy">
<wldeploy action="deploy"
source="${build}/ejb11_basic_statelessSession.ear" name="ejbapp"
user="a" password="a" verbose="true" adminurl="t3://localhost:7001"
debug="true" targets="myserver"/>
</target>
The following sample shows a more advanced wldeploy
target that redeploys a single file in an exploded Web Application:
<target name="redeploy">
<wldeploy action="redeploy"
source="c:\myapps\myWebApp\" name="myWebApp"
user="weblogic" password="weblogic" verbose="true"
adminurl="t3://localhost:7001"
debug="true" targets="examplesServer">
<files file="index.jsp"/>
</wldeploy>
</target>
The following table describes the attributes of the wldeploy
Ant task. For more information about the definition of various terms, see weblogic.Deployer Actions and Options
The deployment action to perform. Valid values are |
|||
Specifies the name of an alternate J2EE deployment descriptor ( |
|||
Specifies the name of an alternate WebLogic Server deployment descriptor ( |
|||
Specifies whether the deployment uses external_stage deployment mode. |
|||
Specifies a file or list of files on which to perform a deployment action (for example, a list of JSPs to redeploy). See Sample build.xml Files for wldeploy. |
|||
Identification used for obtaining status or cancelling the deployment. |
|||
Specifies whether the deployment uses nostage deployment mode. |
|||
Specifies whether wldeploy returns immediately after making a deployment call (by deploying as a background task). |
|||
To avoid having the plain text password appear in the build file or in process utilities such as If you want to obtain a username and password from a non-default configuration file and key file, use the See STOREUSERCONFIG in the weblogic.Admin Command-Line Reference for more information on storing and encrypting passwords. |
|||
Specifies whether the server is located on a different machine. This affects how filenames are transmitted. |
|||
Specifies whether the deployment uses stage deployment mode. |
|||
Specifies whether the source file(s) are copied to the Administration Server's upload directory prior to deployment. |
|||
Specifies the location of a user configuration file to use for obtaining the administrative username and password. Use this option, instead of the |
|||
Specifies the location of a user key file to use for encrypting and decrypting the username and password information stored in a user configuration file (the |
|||
Specifies whether |
|||
This is a global attribute used by WebLogic Server Ant tasks. It specifies whether the task should fail if it encounters an error during the build. This attribute is set to true by default. |
WebLogic Builder is a WebLogic Server tool for generating and editing deployment descriptors for J2EE applications. It can also deploy applications to single servers.
See the WebLogic Builder Online Help.
A deployment task is initiated through a DeployerRuntimeMBean—a singleton (an object for which only one instance exists) that resides on an Administration Server. DeployerRuntimeMBean provides methods for activating, deactivating, and removing an application. These methods return a DeploymentTaskRuntimeMBean that encapsulates the request and provides the means for tracking its progress. DeploymentTaskRuntimeMBean provides ongoing status of the request through TargetStatus objects, one per target.
The WebLogic Server deployment management API is defined by the following WebLogic Server MBeans:
The deployment management API is asynchronous. The client must poll the status or utilize ApplicationMBean notifications to determine when the task is complete.
For more information about WebLogic Server deployment management APIs, see the weblogic.management.deploy Javadoc.