Required Environment for weblogic.Deployer

To set up your environment to use the weblogic.Deployer utility:

Install and configure the WebLogic Server software, as described in the Oracle WebLogic Server Installation Guide.

Add the WebLogic Server classes to the CLASSPATH environment variable, and ensure that the correct JDK binaries are available in your PATH. You can use the setWLSEnv.sh or setWLSEnv.cmd script, located in the server/bin subdirectory of the WebLogic Server installation directory, to set the environment.

If you are connecting to an Administration Server through a configured Administration channel, you must also configure SSL on the machine on which you run weblogic.Deployer. See Configuring SSL in Securing Oracle WebLogic Server for instructions about configuring SSL.

Syntax for Invoking weblogic.Deployer

Command names and options are not case-sensitive. See Commands and Options for detailed syntax and examples of using weblogic.Deployer commands.

Caution:

Entering unencrypted passwords in weblogic.Deployer commands, whether entered in a command window or a script, is a security risk because they can be viewed by others. For information about entering passwords securely, see "Securing the WebLogic Server Host" in Securing a Production Environment for Oracle WebLogic Server.

If you have enabled the domain-wide administration port, or if you want to secure your administrative request by using some other listen port that is secured by SSL, you must include SSL arguments when you invoke weblogic.Deployer. Table A-1 describes all SSL arguments for the weblogic.Deployer utility.

Table A-1 SSL Arguments

Argument

Definition

-Dweblogic.security.TrustKeyStore=DemoTrust

Causes weblogic.Deployer to trust the CA certificates in the demonstration trust keystore (WL_HOME\server\lib\DemoTrust.jks).

This argument is required if the server instance to which you want to connect is using the demonstration identity and certificates.

By default, weblogic.Deployer trusts only the CA certificates in the Java Standard Trust keystore (SDK_HOME\jre\lib\security\cacerts).

-Dweblogic.security.JavaStandardTrustKeyStorePassPhrase=password

Password that was used to secure the Java Standard Trust keystore.

If the Java Standard Trust keystore is protected by a password, and if you want to trust its CA certificates, you must use this argument.

By default, the Java Standard Trust keystore is not protected by a password.

Causes weblogic.Deployer to trust the CA certificates in a custom keystore that is located at filename. You must use both arguments to trust custom keystores. The filename must match exactly the ServerMBean.CustomTrustKeyStoreFileName value persisted in config.xml; if the value specified in the CustomTrustKeyStoreFileName attribute is a relative pathname, you must also specify the same relative pathname in this argument.

-Dweblogic.security.CustomTrustKeyStorePassPhrase=password

Password that was used to secure the custom keystore.

You must use this argument only if the custom keystore is protected by a password.

-Dweblogic.security.SSL.hostnameVerifier=classname

Name of a custom Host Name Verifier class. The class must implement the weblogic.security.SSL.HostnameVerifier interface.

Connection Arguments

Most weblogic.Deployer commands require you to specify the -adminurl arguments described in Table A-2 to connect to an Administration Server instance.

Table A-2 Connection Arguments

Argument

Definition

-adminurl [protocol://]Admin-Server-listen-address:listen-port

Listen address and listen port of the Administration Server.

To use a port that is not secured by SSL, the format is -adminurl [protocol]Admin-Server-listen-address:port where t3, http, iiop, and iiops are valid protocols.

In order to use an adminurl with the HTTP protocol, you must enable the HTTP tunneling option in the Administration Console. For more information, see Setting Up WebLogic Server for HTTP Tunneling in Configuring Server Environments for Oracle WebLogic Server. For instructions on enabling HTTP tunneling in the Administration Console, see Configure HTTP protocol in Oracle WebLogic Server Administration Console Help.

To use a port that is secured by SSL, the format is -adminurlsecure-protocol://Admin-Server-listen-address:port where t3s and https are valid secure protocols.

To connect to the Administration Server via a configured Administration channel, you must specify a valid administration port number: -adminurlsecure-protocol://Admin-Server-listen-address:domain-wide-admin-port

Most weblogic.Deployer commands require you to provide the user credentials of a WebLogic Server administrator.

Table A-3 User Credentials Arguments

Argument

Definition

-username username

Administrator username. If you supply the -username option but you do not supply a corresponding -password option, weblogic.Deployer prompts you for the password.

-password password

Password of the Administrator user.

To avoid having the plain text password appear in scripts or in process utilities such as ps, first store the username and encrypted password in a configuration file using the WebLogic Scripting Tool (WLST) storeUserConfig command as described in the WebLogic Scripting Tool Command Reference. Omit both the -username and -password options to weblogic.Deployer to use the values stored in the default configuration file.

If you want to use a specific configuration file and key file, rather than the default files, use the -userconfigfile and -userkeyfile options to weblogic.Deployer.

-userconfigfile config-file

Location of a user configuration file to use for the administrative username and password. Use this option, instead of the -user and -password options, in automated scripts or in situations where you do not want to have the password shown on-screen or in process-level utilities such as ps. Before specifying the -userconfigfile attribute, you must first generate the file using the WebLogic Scripting Tool (WLST) storeUserConfig command as described in the WebLogic Scripting Tool Command Reference.

-userkeyfile admin-key

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 -userconfigfile option). Before specifying the -userkeyfile attribute, you must first generate the file using the WebLogic Scripting Tool (WLST) storeUserConfig command as described in the WebLogic Scripting Tool Command Reference.

Prints full command-line help text for all weblogic.Deployer actions and options.

-debug

Display debug messages in the standard output.

-examples

Display example command lines for common tasks.

-help

Prints command-line help text for the most commonly used weblogic.Deployer actions and options.

-noexit

By default weblogic.Deployer calls System.exit(1) if an exception is raised during command processing. The exit value displayed indicates the number of failures that occurred during the deployment operation.

The -noexit option overrides this behavior for batch processing.

-noversion

Indicates that weblogic.Deployer should ignore all version related code paths on the Administration Server. This behavior is useful when deployment source files are located on Managed Servers (not the Administration Server) and you want to use the external_stage staging mode.

If you use this option, you cannot use versioned applications.

-nowait

weblogic.Deployer prints the task ID and exits without waiting for the action to complete. This option initiates multiple tasks and then monitor them later with the -list action.

-output <raw | formatted>

(Deprecated.) Either raw or formatted to control the appearance of weblogic.Deployer output messages. Both output types contain the same information, but raw output does not contain embedded tabs. By default, weblogic.Deployer displays raw output.

-purgetasks

Indicates that weblogic.Deployer should flush out deployment tasks that are retired.

-remote

Indicates that weblogic.Deployer is not running on the same machine as the Administration Server, and that source paths specified in the command are valid for the Administration Server machine itself. If you do not use the -remote option, weblogic.Deployer assumes that all source paths are valid paths on the local machine.

-timeout seconds

Maximum time, in seconds, to wait for the deployment task to complete. After the time expires, weblogic.Deployer prints out the current status of the deployment and exits.

-verbose

Additional progress messages, including details about the prepare and activate phases of the deployment.

-version

Prints version information for weblogic.Deployer.

Commands and Options

The following sections describe the weblogic.Deployer commands and command options used to perform deployment tasks with WebLogic Server:

Deployment name to assign to a newly-deployed application or standalone module.

Both the -name option and deployment_name argument are optional, as described in the Syntax. If a deployment name is not explicitly identified with the deploy command, the name is derived from the specified deployment file or directory:

For an archive file, the default deployment name is the full name of the archive file with the file extension. For example, when deploying myear.ear, the default deployment name is myear.ear.

For an exploded archive directory, the default deployment name is the name of the top-level directory.

If you specify an application installation root directory, the default deployment name is derived from the archive filename or exploded archive directory name in the /app subdirectory.

-source file

Archive file or exploded archive directory to deploy. You can omit the -source option and supply only the file or directory to deploy.

-plan file

Deployment plan to use when deploying the application or module. By default, weblogic.Deployer does not use an available deployment plan, even if you are deploying from an application root directory that contains a plan.

-targets target_list

Targets on which to deploy the application or module.

The target_list argument is a comma-separated list of the target servers, clusters, or virtual hosts. Each target may be qualified with a Java EE module name (<module1>@<server1>). This enables you to deploy different modules of an Enterprise application to different servers or clusters. For more information, see Using Module-Level Targeting for Deploying an Enterprise Application.

If you do not specify a target list with the deploy command, the target defaults to:

Transfers the specified deployment files, including deployment plans and alternate deployment descriptors, to the Administration Server. Use this option when you are on a remote machine and you cannot copy the deployment files to the Administration Server by other means. The application files are uploaded to the WebLogic Server Administration Server upload directory prior to distribution and deployment.

-stage | -nostage | -external_stage

Staging mode to use when deploying or distributing an application:

-stage—Copies deployment files to target servers' staging directories. stage is the default mode used when deploying or distributing to Managed Server targets.

-nostage—Does not copy the deployment files to target servers, but leaves them in a fixed location, specified by the -source option. Target servers access the same copy of the deployment files. nostage is the default used when deploying or distributing to the Administration Server (for example, in a single-server domain).

-external_stage—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. You can manually copy the files or use a third-party tool or script.

Specification version of a Java EE library or optional package. This option can be used only if the library or package does not include a specification version in its manifest file. -libversion can be used only in combination with -library. See Registering Libraries with WebLogic Server.

-libimplver version

Implementation version of a Java EE library or optional package. This option can be used only if the library or package does not include an implementation version in its manifest file. -libimplversion can be used only in combination with -library. See Registering Libraries with WebLogic Server.

-usenonexclusivelock

Deployment operation uses an existing lock, already acquired by the same user, on the domain. This option is helpful in environments where multiple deployment tools are used simultaneously and one of the tools has already acquired a lock on the domain configuration.

-altappdd file

(Deprecated.) Name of an alternate Java EE deployment descriptor (application.xml) to use for deployment.

-altwlsappdd file

(Deprecated.) Name of an alternate WebLogic Server deployment descriptor (weblogic-application.xml) to use for deployment.

Task identifier of a running deployment task. You can specify an identifier with the distribute, deploy, redeploy, start, or undeploy commands, and use it later as an argument to the cancel or list commands. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one.

Distribute

A distributed application can be started quickly with the "Start" command. You can start the application in Administration mode, or make it available to Administration and client requests. While in Administration mode, the application can be accessed only by internal clients through a configured Administration port. External clients cannot access the application.

Both the -name option and deployment_name argument are optional, as described in the Syntax. If a deployment name is not explicitly identified, a name is derived from the specified deployment file or directory:

For an archive file, the default deployment name is the name of the archive file without the file extension (myear for the file myear.ear).

For an exploded archive directory, the default deployment name is the name of the top-level directory.

If you specify an application installation root directory, the default deployment name is derived from the archive filename or exploded archive directory name in the /app subdirectory.

-source file

Archive file or exploded archive directory to distribute. You can omit the -source option and supply only the file or directory.

-plan file

Deployment plan to distribute with the application or module, used to configure the application.

-targets target_list

Targets on which to distribute the application or module.

The target_list argument is a comma-separated list of the target servers, clusters, or virtual hosts. Each target may be qualified with a Java EE module name (<module1>@<server1>). This enables you to distribute different modules of an Enterprise application to different servers or clusters. For more information, see Using Module-Level Targeting for Deploying an Enterprise Application.

If you do not specify a target list with the distribute command, the target defaults to:

Transfers the specified deployment files, including any specified deployment plans, to the Administration Server before distribution. Use this option when you are on a remote machine and you cannot copy the deployment files to the Administration Server by other means. The application files are uploaded to the WebLogic Server Administration Server upload directory prior to distribution.

-stage | -nostage | -external_stage

Staging mode to use when deploying or distributing an application:

-stage—Copies deployment files to target servers' staging directories. stage is the default mode used when deploying or distributing to Managed Server targets.

-nostage—Does not copy the deployment files to target servers, but leaves them in a fixed location, specified by the -source option. Target servers access the same copy of the deployment files. nostage is the default used when deploying or distributing to the Administration Server (for example, in a single-server domain).

-external_stage—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. You can manually copy the files or use a third-party tool or script.

Specification version of a Java EE library or optional package. This option can be used only if the library or package does not include a specification version in its manifest file. -libversion can be used only in combination with -library. See Registering Libraries with WebLogic Server.

-libimplver version

Implementation version of a Java EE library or optional package. This option can be used only if the library or package does not include a implementation version in its manifest file. -libimplversion can be used only in combination with -library. See Registering Libraries with WebLogic Server.

-altappdd file

(Deprecated.) Name of an alternate Java EE deployment descriptor (application.xml) to use for deployment or distribution.

-altwlsappdd file

(Deprecated.) Name of an alternate WebLogic Server deployment descriptor (weblogic-application.xml) to use for deployment or distribution.

Task identifier of a running deployment task. You can specify an identifier with the distribute, deploy, redeploy, start, or undeploy commands, and use it later as an argument to the cancel or list commands. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one.

Examples

The distribute command operates similar to deploy, but WebLogic Server does not start the application or module on target servers. See the examples links for "Deploy" command for more information.

Listapps

Lists the deployment names for applications and standalone modules deployed, distributed, or installed to the domain.

When used with the redeploy command, the -source option specifies the location of new deployment files to redeploy, for example, when updating an application to a new version or when rolling back to the previously deployed version.

Note: Do not specify the redeploy-source option for non-versioned applications or existing versioned applications if the source location has changed. In those cases, you must first undeploy, then deploy the application.

To specify multiple files for a partial redeployment, omit the -source option and supply only a filelist.

When redeploying an application, the -plan option allows you to specify an updated configuration to use during the redeployment. If the revised deployment plan contains changes to resource bindings, WebLogic Server attempts to redeploy a new version of the application alongside an older version. See Updating the Deployment Configuration for an Application.

-targets target_list

Targets on which to redeploy the application or module.

The target_list argument is a comma-separated list of the target servers, clusters, or virtual hosts. Each target may be qualified with a Java EE module name (<module1>@<server1>). This enables you to redeploy different modules of an Enterprise application to different servers or clusters. For more information, see Using Module-Level Targeting for Deploying an Enterprise Application.

Transfers the specified deployment files, including deployment plans and alternate deployment descriptors, to the Administration Server. Use this option when you are on a remote machine and you cannot copy the deployment files to the Administration Server by other means. The application files are uploaded to the WebLogic Server Administration Server upload directory prior to distribution and deployment.

-delete_files

Removes static files from a server's staging directory. delete_files is valid only for unarchived deployments, and only for applications deployed using -stage mode. You must specify target servers when using this option, as shown in the following example:

delete_files only removes files that WebLogic Server copied to the staging area during deployment. If you use the delete_files option with an application that was deployed using either -nostage or -external_stage mode, the command does not delete the files.

Note: delete_files can only be used in combination with the redeploy command.

Because the -delete_files option deletes all specified files or, if you specify a directory but do not specify files within the directory, all files in the specified directory, Oracle recommends that you use caution when using the delete_files option and that you do not use the delete_files option in production environments.

The amount of time, in seconds, that the work manager accepts and schedules RMI calls until there are no more RMI requests arriving within the RMI grace period during a graceful shutdown or a retirement.

-id task_id

Task identifier of a running deployment task. You can specify an identifier with the deploy, redeploy, or undeploy commands, and use it later as an argument to the cancel or list commands. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one.

Examples

See the following sections for examples of using the redeploy command:

Start

Makes a stopped (inactive) application available to clients on target servers. The start command does not redistribute deployment files to target servers. Optionally, with the adminmode option, starts the application in Administration mode, which makes it available only via a configured Administration channel. In order to issue a start command, the files must already be available through a deploy or distribute command.

Start application in Administration mode, not Production mode (which is the default).

-name deployment_name

Deployment name of a deployed application or module. The name option can be omitted, in which case the name is taken directly from the deployment_name. (If the deployment_name specifies a file or directory name, the deployment name is derived from the file specification.)

-appversion version

Version of the application to start.

-planversion version

Version of the deployment plan to use when starting the application.

-targets target_list

Targets on which to start the application or module.

The target_list argument is a comma-separated list of the target servers, clusters, or virtual hosts. Each target may be qualified with a Java EE module name (<module1>@<server1>). This enables you to start different modules of an Enterprise application on different servers or clusters. For more information, see Using Module-Level Targeting for Deploying an Enterprise Application.

If you do not specify a target list with the start command, the target defaults to:

The Administration Server instance for new deployments.

The application's current targets for deployed applications.

If you do not specify a target list with the start command, the command is performed on all of the application's current targets.

Task identifier of a running deployment task. You can specify an identifier with the distribute, deploy, redeploy, start, or undeploy commands, and use it later as an argument to the cancel or list commands. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one.

Examples

Stop

Makes an application inactive and unavailable administration and client requests. All of the application's staged files remain available on target servers for subsequent start, deploy, redeploy, or undeploy actions. Optionally, choose to make the application unavailable to client requests by placing it in Administration mode with the adminmode option. While in Administration mode, the application be accessed only through a configured Administration channel.

Indicates that a running application should switch to Administration mode and accept only Administration requests via a configured Administration channel. If this option is not specified, the running application is stopped and cannot accept Administration or client requests until is it restarted.

-name deployment_name

Deployment name of a deployed application or module. The name option can be omitted, in which case the name is taken directly from the deployment_name. (If the deployment_name specifies a file or directory name, the deployment name is derived from the file specification.)

-appversion version

Version identifier of the deployed application.

-planversion version

Version identifier of the deployment plan.

-targets target_list

Targets on which to stop the application or module.

The target_list argument is a comma-separated list of the target servers, clusters, or virtual hosts. Each target may be qualified with a Java EE module name (<module1>@<server1>). This enables you to stop different modules of an Enterprise application on different servers or clusters. For more information, see Using Module-Level Targeting for Deploying an Enterprise Application.

If you do not specify a target list with the stop command, the target defaults to:

The Administration Server instance for new deployments.

The application's current targets for deployed applications.

If you do not specify a target list with the stop command, the command is performed on all of the application's current targets.

Stops the application after existing HTTP clients have completed their work. If you do not specify the -graceful option, WebLogic Server immediately stops the application or module. See Taking a Production Application Offline.

-rmiGracePeriod seconds

The amount of time, in seconds, that the work manager accepts and schedules RMI calls until there are no more RMI requests arriving within the RMI grace period during a graceful shutdown or a retirement.

-ignoresessions

Immediately places the application into Administration mode without waiting for current HTTP sessions to complete.

-id task_id

Task identifier of a running deployment task. You can specify an identifier with the distribute, deploy, redeploy, start, stop, or undeploy commands, and use it later as an argument to the cancel or list commands. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one.

Undeploy

When you undeploy an application that contains application-scoped resources, the resources are deleted along with the application, which can potentially cause abandoned transactions or lost messages as a result of deleted JMS destinations. For more information, see Unregister Resource Grace Period in Programming JTA for Oracle WebLogic Server.

You should only undeploy applications that you are certain you want to completely remove; to temporarily stop client access to applications, use the stop command, described in Stop, instead.

Deployment name of a deployed application or module. The name option can be omitted, in which case the name is taken directly from the deployment_name. (If the deployment_name specifies a file or directory name, the deployment name is derived from the file specification.)

-appversion version

Version identifier of the deployed application.

-planversion version

Version identifier of the deployment plan.

-targets target_list

Targets from which the application or module are undeployed.

Note: Any target not included in the target list is not removed.

The target_list argument is a comma-separated list of the target servers, clusters, or virtual hosts. Each target may be qualified with a Java EE module name (<module1>@<server1>). This enables you to undeploy different modules of an Enterprise application from different servers or clusters. For more information, see Using Module-Level Targeting for Deploying an Enterprise Application.

-submoduletargets target_list

JMS resources to be undeployed.

Note: Any sub-module target not included in the target list is not removed.

Stops the application after existing HTTP clients have completed their work. If you do not specify the -graceful option, WebLogic Server immediately stops the application or module. See Taking a Production Application Offline.

The module is undeployed after it is stopped.

-rmiGracePeriod seconds

The amount of time, in seconds, that the work manager accepts and schedules RMI calls until there are no more RMI requests arriving within the RMI grace period during a graceful shutdown or a retirement.

-ignoresessions

Immediately stops and undeploys the application without waiting for current HTTP sessions to complete.

-id task_id

Task identifier of a running deployment task. You can specify an identifier with the distribute, deploy, redeploy, start, stop, or undeploy commands, and use it later as an argument to the cancel or list commands. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one.

Examples

See the following sections for examples of using the undeploy command:

Deployment plan to use for updating the application's configuration. The specified deployment plan must be valid for the application's target servers. For example, the plan cannot contain null variables for required resources unless those resources were previously defined in the associated desrciptors.

Update operations update only those descriptors for which there is a changed, not null value in the deployment plan. If a plan that is used by an update operation contains null variables, the current values in the corresponding descriptors are not updated.

-name deployment_name

Deployment name of a deployed application or module. The name option can be omitted, in which case the name is taken directly from the deployment_name. (If the deployment_name specifies a file or directory name, the deployment name is derived from the file specification.)

-appversion version

Version identifier of the deployed application.

-planversion version

Version identifier of the deployment plan.

-targets target_list

Targets on which to update the application or module.

The target_list argument is a comma-separated list of the target servers, clusters, or virtual hosts. Each target may be qualified with a Java EE module name (<module1>@<server1>). This enables you to update different modules of an Enterprise application on different servers or clusters. For more information, see Using Module-Level Targeting for Deploying an Enterprise Application.

If you do not specify a target list with the update command, the target defaults to:

The Administration Server instance for new deployments.

The application's current targets for deployed applications.

If you do not specify a target list with the update command, the command is performed on all of the application's current targets.

Uploads a new deployment plan to the Administration Server before updating the application.

-id task_id

Task identifier of a running deployment task. You can specify an identifier with the distribute, deploy, redeploy, update, start, stop, or undeploy commands, and use it later as an argument to the cancel or list commands. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one.