34 Deploying / Redeploying / Undeploying Java EE Applications

This chapter explains how you can deploy, undeploy, and redeploy Java EE Applications using Oracle Enterprise Manager Cloud Control (Cloud Control).

In particular, this chapter covers the following:

Getting Started with the Deploy/Undeploy Java EE Application Deployment Procedure

This section provides an overview of the steps involved in deploying, redeploying, and undeploying Java EE Applications. The Deploy / Undeploy Java EE Applications Deployment Procedure allows you to perform the following operations:

  • Deploy

  • Undeploy

  • Redeploy

Consider this section to be a documentation map to understand the sequence of actions you must perform to successfully provision a Java EE Application. Click the reference links provided against the steps to reach the relevant sections that provide more information.

Table 34-1 Getting Started with Deploying, Undeploying, or Redeploying a Java EE Application

Step Description Reference Links

Step 1

Understanding the Deployment Procedure

Understand the Deployment Procedures offered by Cloud Control to deploy, undeploy, or redeploy a Java EE Application. Know how the Deployment Procedure function, what use cases it covers, and so on.

To learn about the Deployment Procedure, see Deploying, Undeploying, or Redeploying Java EE Applications.

Step 2

Selecting the Use Case

This chapter covers the use cases for deploying, undeploying, and redeploying Java EE Application. Select the use case that best matches your requirements.

Step 3

Meeting the Prerequisites

Before you run the Deployment Procedure, you must meet the prerequisites, such as configuring the Software Library and creating components to be provisioned as part of the Deploy / Undeploy Java EE Application deployment procedure.

To learn about the prerequisites for deploying, undeploying or redeploying Java EE Application, see Prerequisites for Deploying/Undeploying Java EE Applications.

Step 4

Running the Deployment Procedure

Run the Deployment Procedure to successfully deploy, redeploy, or undeploy one or more Java EE applications.

To run the Deploy / Undeploy Java EE Applications Deployment Procedure, follow the steps explained in Java EE Applications Deployment Procedure.

Deploying, Undeploying, or Redeploying Java EE Applications

This deployment procedure supports deployment of Java EE Applications packaged into .ear, .war, .jar,.rar or .gar files as per Java EE specifications. Administrators can use Cloud Control to deploy, redeploy, and undeploy one or more Java EE applications and need not drill down into the WebLogic Server Administration Console or the Oracle Enterprise Manager Fusion Middleware Control console to perform these tasks. The Java EE applications need to be pre-configured before you add them to the Cloud Control Software Library. You can deploy a pre-configured Java EE application to one or more WebLogic domains in Cloud Control.

The Java EE Application Deployment Procedure offers GUI-rich interactive screens that allow you to deploy / redeploy to, or undeploy a pre-configured Java EE application from one or more WebLogic Domains.

The Enterprise Manager Cloud Control 13c Release 2 Plug-ins Update 1 supports deploying/redeploying/undeploying to resource group templates, global resource groups, or partition resource groups.

Supported Releases for Deploy/Undeploy Java EE Applications Deployment Proceudre

This deployment procedure can be used to deploy, undeploy, or redeploy Java EE Applications to and from WebLogic versions 10.3, 10.3.1 and later, including 12.1.1, 12.1.2, 12.1.3, 12.2.1, 12.2.1.x, and 12.1.x.

WebLogic versions 8.x and 9.x are not supported.

Prerequisites for Deploying/Undeploying Java EE Applications

Before running the Deploy / Undeploy Java EE Applications Deployment Procedure, ensure that the following prerequisites are met:

  • Ensure that the Software Library is configured. See Setting Up Oracle Software Library for details.

  • The Java EE Application component must have been created in the Software Library. See Creating a Java EE Application Component for details.

  • The Management Agent must be installed on the Administration Server host machine for the WebLogic Domain to which you are deploying, undeploying, or redeploying the Java EE application. Deployment commands are executed from the Administration Server host machine.

  • If a target execution script is to be run as part of the deployment procedure, then the Management Agent must be installed on the Managed Server's host machine where the target execution script is to be run.

  • A target execution script can be used to set up the required environment or replace tokens in additional files such as property files. The script will be executed on selected targets.

Creating a Java EE Application Component

You can create a Java EE Application component which contains the archive, deployment plan, predeploy, postdeploy, target execution scripts, and other files required for deploying the Java EE application.

Note:

If you create a Java EE Application component on the host where the Software Library is configured, then you must ensure that this host name and the management agent host name should match, if not, you will see the following error while creating the component:

An error was encountered during saving entity samples.gar.
Please see the log for details.
oracle.sysman.emSDK.app.exception.EMSystemException

To create a Java EE Application component, follow these steps:

  1. From the Enterprise menu, select Provisioning and Patching, then select Software Library.
  2. Create a folder or select a folder from the Software Library, select Create Entity, then select Component.
  3. From the Create Entity: Component dialog box, select Java EE Application and click Continue.
  4. In the Create Java EE Application: Describe page, enter the Name, Description, and click Next.
  5. In the Create Java EE Application: Select Files page, select one or more files to be associated with the Java EE Application. You can upload files from a storage location in the Software Library. For Software Library to become usable, at least one upload file location must be configured. In the Specify Destination section, click the Browse button in the Upload Location field. Select either of the following:
    • OMS Shared File System: An OMS Shared File System location is required to be shared (or mounted) across all the Oracle Management Server (OMS) hosts. This option is ideal for UNIX systems.

      For single OMS environments, you can configure the Software Library either on the host where the OMS is running or in a shared location, so that it is accessible to all the OMS hosts. For multiple OMS environments, Oracle recommends that you configure the Software Library in a shared location so that the storage is accessible through NFS mount points to all Oracle Management Servers in the environment.

    • OMS Agent File System: An OMS Agent File System location is a location that is accessible to one of the OMS host's Agent. This option is ideal for OMS installed on Windows hosts. By selecting this option for uploading files, you can avoid sharing a location between all participating OMS hosts.

      Credentials must be set before using an OMS Shared File System or OMS Agent File System. For an OMS Shared File System, normal host credentials must set before configuring a storage location. However, for OMS Agent File System location configuration, a credential (preferred or named) has to be specified.

  6. In the Specify Source section, you can add the standard Java EE archive files such as .ear, .war, .jar, .rar, .gar, and other optional files such pre and post-deploy scripts, target execution script, execution plan and additional files. You can either upload each file separately (Individual Files) or upload a zip file (Zip File) that contains the JavaEEAppComp.manifest file. You can upload the files from:
    • Local Filesystem: Click Browse and upload the files from your local system.

    • Agent Filesystem: You can upload the files from a remote filesystem monitored by the Management Agent. Click Browse and select a host machine from the list and click Select. Click Add. The Remote File Browser window is displayed. Click the Login As button and enter the credentials for the host machine. Specify the location in which the files are present, select one or more archive related files and click Add. The selected files are listed in the Current Selection section. Click OK to return to the Create Entity: Select Files page.

  7. The files are listed in the table. Specify the type of the file by selecting the options in the Type field. Click Next.
  8. Review and verify the information entered so far. Click Save and Upload to upload the files and create the Java EE Application component.

Java EE Applications Deployment Procedure

This section describes the Java EE Application deployment procedure. It covers the following:

  • Deploying a Java EE Application

  • Undeploying a Java EE Application

  • Redeploying a Java EE Application

Deploying a Java EE Application

Follow these steps to deploy a Java EE Application:

  1. From the Enterprise menu, select Provisioning and Patching, then select Middleware Provisioning.
  2. Select the Java EE Application procedure from the list and click Launch. You can also use the following method to launch the deployment procedure:
    • Click Middleware from the Targets menu.

    • Right click on a WebLogic Domain from the list and from the context sensitive menu, select Provisioning, then select Deploy / Undeploy Java EE Applications.

    • In the Deployment Procedure Manager page, select the Java EE Application Provisioning procedure and click Launch.

  3. In the Deploy/Undeploy Java EE Applications: Select Targets page, choose the Deploy operation.

    Figure 34-1 Deploy / Undeploy Java EE Applications: Select Target


    Deploy / Undeploy Java EE Applications: Select Target

    Each domain has entities like clusters, admin server, managed server, global resource group, resource group templates, and partitions.

    While deploying Multi-Tenancy partitions, each partition has one or more Resource Groups. The deployment is possible for only one of the selected Resource Groups of a partition.

    Click the radio button to select the desired Resource Group for a partition.

    While deploying applications to Resource Groups and Resource Group Templates, you must ensure that application deployment meets the uniqueness criteria of application names set by WebLogic. Deployment procedure wizard validates and ensures the uniqueness in simpler cases. In case of extended resource groups from resource group templates, the uniqueness check is left to WebLogic deployer as Enterprise Manager does not have the hierarchy details. Hence, you must ensure the uniqueness before hand to avoid a deployment procedure failure.

  4. Select WebLogic Domains and select the targets on which the Java EE application is to be deployed. Click Add WebLogic Domains. Choose one or more WebLogic domains from the list and click Select.

    Note:

    You can lock an operation, a target, or an application.. Click the Lock icon to lock an operation or the fields you are configuring in any of the pages in the wizard. Once the fields have been locked, the Operator needs to provide minimal input while running the deployment procedure

  5. The selected WebLogic domains are listed in the Targets table. Select the targets (clusters, managed servers, admin servers, Global Resource Groups, Resource Group Templates, Partitions, or Resource groups) for each domain and click Next.
  6. In the Deploy / Undeploy Java EE Applications: Select Applications page, add the archives and other related files that are to be deployed from the Software Library. Click Add to select one or more archives and other application related files or components from the Software Library. The Add Application popup is displayed. In the Component Name field, enter a file name or a wild card pattern to search for and retrieve components from the Software Library. Select the Show Java EE Application Components Only checkbox to list only the Java EE Application components in the Components in Software Library column. Select the archives and click the right arrow to move them to the Components Selected for Deployment section.

    Figure 34-2 Deploy / Undeploy Java EE Applications: Add Applications


    Deploy / Undeploy Java EE Applications: Add Applications

    Note:

    In the image shown above, Application Version and Plan Version will not be visible if you are redeploying non-versioned application.

  7. In the Type field, the type of each component is displayed. The Type can be:
    • Archive: This is the archive file which can be a .ear, .war, .jar, .rar, or .gar file.

      Note:

      If you have selected a .gar archive file, the WebLogic Domain to which the application is being deployed must be 12.1.2.0.0 or higher.

    • Plan: This is an .xml file containing the deployment options for this application.

    • Pre Deploy Script: This is a script containing WLST commands. The Management Agent runs this script on the Administration Server of each WebLogic domain before the application is deployed. You can use this script to create data sources, JMS end points, and any other resources that might be needed by the application that is being deployed.

    • Post Deploy Script: This is a WLST script that is executed by the Management Agent on the Administration Server after the application is deployed. You can use this script to perform any post deployment configuration. For example, if you need to roll back and undo the changes made by the pre deploy script, you can select this option.

      Note:

      The archive, plan, predeploy, and postdeploy scripts can be moved only to the Administration Server.

    • Additional File: You can add one or more files that will be required by the application that are not part of the application archive. These files can be of any type and can be moved only to the selected targets (managed servers and clusters).

    • Target Execution Script: These scripts can be used to set up the required environment or replace tokens in the additional files like property files. These scripts will be executed on selected targets.

  8. In the Location On Target field, for each component, specify the location on the WebLogic Server Host on which the application is to be deployed. This can be an absolute path or relative to the $WLS_HOME for the selected targets.
  9. After selecting the required files for deployment, enter a unique name for the application and specify the Staging Mode which can be:
    • Default: Each server in the WebLogic Domain maintains two attributes which are Staging Mode and StagingDirectoryName. The Staging Mode is the default staging mode for the server and StagingDirectoryName is the location on which the staged files are stored. Select this option to use the default staging mode for all the targets.

    • Stage: Select this option if the archive files should be moved to the destination machine.

    • No Stage: Select this option if the archive files should not be moved to the destination machine.

  10. Select the Deploy this archive as library option if the application needs to be deployed as a shared library. You can select this option if one or more applications need the same set of files.
  11. Select the Start Mode for deployment which can be:
    • Start in full mode (servicing all requests): Select this option to make the deployed application available to all users.

    • Start application in admin mode (servicing only administration requests): If you select this option, the deployed application is available only to the Administrator.

    • Do not start: The application is deployed but not started. You can select this option if any manual post-deployment configuration is required.

  12. Click OK to add the archive and return to the Select Applications page. You can add more archives or click Next to proceed. If you have added more than one archive, select the Skip on Failure checkbox to skip any failed deployments and continue deploying the remaining applications.
  13. Click the Lock icon to lock the fields you have configured.

    Note:

    The Designer can lock the fields after configuring them. This ensures that the Operator can run the deployment procedure with minimal input.

  14. Click Next. Specify the credentials for each domain you have selected, the host on which the Administration Server is running, and the hosts to which the additional files or execution scripts are to be moved. You can choose:
    • Preferred Credentials: This option is selected by default and the preferred credentials stored in the Management Repository are used. This option is available only if it has already been defined in Cloud Control.

    • Named Credentials: A named credential specifies the authentication information for a user and can be a combination of username / password, public and private key pair, and can be used to perform provisioning, patching, run jobs, and other system management tasks.

    After selecting the credentials, click Apply.

    For more information on setting up the credentials, see Enterprise Manager Security Guide.

  15. Click the Lock icon to lock the fields you have configured. These fields cannot be edited once they are locked.
  16. In the Schedule Deployment page, you can schedule the date on which the Java EE Application deployment procedure should be executed.
  17. Click Next. On the Review page, review the details you have provided for the Deployment Procedure. If you are satisfied with the details, then click Submit to run the Deployment Procedure according to the schedule set. If you want to modify the details, click the Edit link in the section to be modified or click Back repeatedly to reach the page where you want to make the changes.

    After you submit the deployment procedure, you will return to the Procedure Activity page where you can view the status of the Deployment Procedure. After the Java EE Application has been deployed, you can search for the target and navigate to the Target Home page.

Redeploying a Java EE Application

Follow these steps to redeploy a Java EE application:

  1. From the Enterprise menu, select Provisioning and Patching, then select Middleware Provisioning.
  2. Select the Java EE Application procedure from the list and click Launch. You can also use the following method to launch the deployment procedure:
    • Click Middleware from the Targets menu.

    • Right click on a WebLogic Domain from the list and from the context sensitive menu, select Provisioning, then select Deploy / Undeploy Java EE Applications.

    • In the Deployment Procedure Manager page, select the Java EE Application Provisioning procedure and click Launch.

  3. In the Select Targets page, choose the Redeploy operation.

    Note:

    Click the Lock icon to lock an operation or the fields you are configuring in any of the pages in the wizard. Once the fields have been locked, the Operator needs to provide minimal input while running the deployment procedure.

  4. Click Add WebLogic Domains to add one or more WebLogic domains. In the list of targets displayed, choose a target and click Select.
  5. The deployment targets are listed in the Targets table. Select the applications that need to be redeployed and click Next.
  6. In the Select Applications page, a list of applications that can be redeployed are displayed. Select an application and click Edit to modify the archive details and other application related files. In the Application Details window, enter a file name or a wild card pattern to search for and retrieve files from the Software Library. Select the archives and click the right arrow to move them to the Components Selected for Deployment section.
  7. In the Type field, the type of each component is displayed. The Type can be:
    • Archive: This is the archive file which can be a .ear, .war, .jar, or .rar file.

    • Plan: This is an .xml file containing the deployment options for this application.

    • Pre Deploy Script: This is a script containing WLST commands. The Management Agent runs this script on the Administration Server of each WebLogic domain before the application is deployed. You can use this script to create data sources, JMS end points, and any other resources that might be needed by the application that is being deployed.

    • Post Deploy Script: This is a WLST script that is executed by Management Agent on the Administration Server after the application is deployed. You can use this script to perform any post deployment configuration. For example, if you need to roll back and ndo the changes made by the pre deploy script, you can select this option.

      Note:

      The archive, plan, predeploy, and postdeploy scripts can be moved only to the Administration Server.

    • Additional File: You can add one or more files that will be required by the application that are not part of the application archive. These files can be of any type and can be moved only to the selected targets (managed servers and clusters).

    • Target Execution Script: These scripts can be used to set up the required environment or replace tokens in the additional files like property files. These scripts will be executed on selected targets.

  8. Review the default location on the target machine on which the component will reside. This can be an absolute path or relative to the $WLS_HOME for the selected targets.
  9. After selecting the required files for deployment, enter a unique name for the application and specify the Staging Mode which can be:
    • Default: Each server in the WebLogic Domain maintains two attributes which are Staging Mode and StagingDirectoryName. The Staging Mode is the default staging mode for the server and StagingDirectoryName is the location on which the staged files are stored. Select this option to use the default staging mode for all the targets.

    • Stage: Select this option if the archive files should be moved to the destination machine.

    • No Stage: Select this option if the archive files should not be moved to the destination machine.

  10. Select the Start Mode for deployment which can be:
    • Start in full mode (servicing all requests): Select this option to make the deployed application available to all users.

    • Start application in admin mode (servicing only administration requests): If you select this option, the deployed application is available only to the Administrator.

    • Do not start: The application is deployed but not started. You can select this option if any post-deployment configuration is required.

  11. Specify the Retirement Policy for the application. You can select:
    • Allow the application to finish its current sessions and then retire: Select this option if all the current sessions should be completed before retirement.

    • Retire the previous version after retire timeout: Specify a timeout period after which the application will be automatically retired.

    Note:

    The Retirement Policy field is applicable only when you are redeploying versioned application.

  12. Click OK to add the archive and return to the Select Applications page. You can add more archives or click Next to proceed. If you have added more than one archive, select the Skip on Failure checkbox to skip any failed deployments and continue deploying the remaining applications.
  13. Click the Lock icon to lock the fields you have configured. These fields cannot be edited once they are locked.
  14. Click Next. Specify the credentials for each domain you have selected, the host on which the Administration Server is running, and the hosts to which the additional files or execution scripts are to be moved. You can choose:
    • Preferred Credentials: This option is selected by default and the preferred credentials stored in the Management Repository are used. This option is available only if it has already been defined in Cloud Control.

    • Named Credentials: A named credential specifies the authentication information for a user and can be a combination of username / password, public and private key pair, and can be used to perform provisioning, patching, run jobs, and other system management tasks.

    For more information on setting up the credentials, see Enterprise Manager Security Guide.

  15. Click the Lock icon to lock the fields you have configured. These fields cannot be edited once they are locked.
  16. In the Schedule Deployment page, you can schedule the date on which the Java EE Application deployment procedure should be executed.
  17. Click Next. On the Review page, review the details you have provided for the Deployment Procedure. If you are satisfied with the details, then click Submit to run the Deployment Procedure according to the schedule set. If you want to modify the details, click the Edit link in the section to be modified or click Back repeatedly to reach the page where you want to make the changes.

    After you submit the deployment procedure, you will return to the Procedure Activity page where you can view the status of the Deployment Procedure. After the Java EE Application has been redeployed, you can search for the target and navigate to the Target Home page.

Undeploying a Java EE Application

Follow these steps to undeploy a Java EE Application:

  1. From the Enterprise menu, select Provisioning and Patching, then select Middleware Provisioning.
  2. Select the Java EE Application procedure from the list and click Launch. You can also use the following method to launch the deployment procedure:
    • Click Middleware from the Targets menu.

    • Right click on a WebLogic Domain from the list and from the context sensitive menu, select Provisioning, then select Deploy / Undeploy Java EE Applications.

    • In the Deployment Procedure Manager page, select the Java EE Application Provisioning procedure and click Launch.

  3. In the Select Targets page, choose the Undeploy operation.
  4. Click Add WLS Domains to add one or more WebLogic domains. In the list of targets displayed, choose a target and click Select.
  5. The deployment targets are listed in the Targets table. Select the application that needs to be undeployed and click Next.

    undeployment

    You can select the Delete EM Target checkbox for each selected application to automatically erase target history after the undeployment procedure.

  6. Specify the credentials for each domain you have selected, the host on which the Administration Server is running, and the hosts to which the additional files or execution scripts are to be moved. You can choose:
    • Preferred Credentials: This option is selected by default and the preferred credentials stored in the Management Repository are used. This option is available only if it has already been defined in Cloud Control.

    • Named Credentials: A named credential specifies the authentication information for a user and can be a combination of username / password, public and private key pair, and can be used to perform provisioning, patching, run jobs, and other system management tasks.

    For more information on setting up the credentials, see Enterprise Manager Security Guide.

  7. Specify the deployment schedule and click Next.
  8. Review the details and click Undeploy. You will return to the Procedure Activity page where you can check the status.

Deploying / Redeploying / Undeploying Java EE Applications Using EMCLI

This section lists the procedures to deploy, redeploy, or undeploy a Java EE application using EMCLI:

Deploying a Java EE Application Using EMCLI

To deploy a Java EE application using EMCLI, run the following command:

emcli submit_procedure -name="JAVAEE_APPLICATION_DEPLOYMENT" -input_file=data="/input-deploy.properties" 
[instance_name="javaee_deploy"]

Sample Input File

This section shows the format of a sample input-deploy.propertiesfile.

stopOnError=true
operation=Deploy

#Host Creds for all the hosts part of the domain
domains.0.domainTargetName=/Farm01_wls1213_njrf_1c1ms/wls1213_njrf_1c1ms
domains.0.wlsCredType=New
domains.0.wlsUserName=weblogic1
domains.0.wlsPassword=welcome1$
#domains.0.credName=wls_creds:SYSMAN

#Host Creds for all the hosts part of the domain
domains.0.hosts.0.hostName=hostname.example.com
domains.0.hosts.0.hostCredType=New
domains.0.hosts.0.hostUserName=<USERID>
domains.0.hosts.0.hostPassword=<PASSWORD> 
#domains.0.hosts.0.hostCredName=user1_creds:<USERID>

#For each application
domains.0.javaeeApps.0.appName=MyCalender
domains.0.javaeeApps.0.isSharedLib=false
domains.0.javaeeApps.0.stageMode=DEFAULT
domains.0.javaeeApps.0.startMode=full
domains.0.javaeeApps.0.retirementPolicy=true
domains.0.javaeeApps.0.retirementTimeout=0
domains.0.javaeeApps.0.targets=Cluster_1
#domains.0.javaeeApps.0.deleteTarget=false

domains.0.javaeeApps.0.archiveSwLibPath=demo_folder/calendar_app
domains.0.javaeeApps.0.archiveFileName=Calendar.war
domains.0.javaeeApps.0.archiveStagingLocation=/my_arch/mystage

# If there is no plan, then this can be skipped
#domains.0.javaeeApps.0.planSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.planFileName=xyz.jar
#domains.0.javaeeApps.0.planStagingLocation=/my_plan/mystage

# If there is no predeploy script, this can be skipped
#domains.0.javaeeApps.0.preDeployScriptSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.preDeployScriptFileName=xyz.py
#domains.0.javaeeApps.0.preDeployScriptStagingLocation=/my_prescript/mystage

# If there is no postdeploy script, this can be skipped
#domains.0.javaeeApps.0.postDeployScriptSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.postDeployScriptFileName=xyz.py
#domains.0.javaeeApps.0.postDeployScriptStagingLocation=/my_postscript/mystage

# If there are no additional scripts, this can be skipped
#domains.0.javaeeApps.0.additionalFiles.0.swLibPath=my_folder/calpp
#domains.0.javaeeApps.0.additionalFiles.0.fileName=additional.zip
#domains.0.javaeeApps.0.additionalFiles.0.stagingLocation=/my_add/mystage

# If there is no target execution script, this can be skipped
#domains.0.javaeeApps.0.targetExecScriptSwLibPath=my_folder/my_script
#domains.0.javaeeApps.0.targetExecScriptFileName=script.pl
#domains.0.javaeeApps.0.targetExecScriptStagingLocation=/my_exec/mystage

Description of the Input File

  • stopOnError: Set this flag to true if the deployment procedure should stop when an error is encountered while a Java EE application is being deployed.

  • operation: The type of operation (Deploy) being performed.

  • Domain Details: Specify the details of the WebLogic domains on which these applications are being deployed.

    • domains.0.domainTargetNamewhere:
      • 0 is the index of the domain

      • domainTargetName is the name of the target in Enterprise Manager.

    • domains.0.wlsCredType: The credentials for the domain. Possible values are Preferred, New, or Named Credentials.
    • domains.0.wlsUserName (optional): If New Credentials are selected, specify the user name here.

    • domains.0.wlsPassword (optional): If New Credentials are selected, specify the password here.

    • domains.0.credName (optional): If Named Credentials are selected, specify the name of the credentials followed by the name of the credential owner in the format <cred_name>:<owner_name>. For example, user1_creds:SYSMAN.
  • Host Details:

    Specify the Administration Server host details here.
    • hosts.0.hostName: where:

      • 0 is the index for the Administration Server host. If additional files, and target execution scripts are present, indexes 1, 2, 3, and so on must be used for all the other hosts in the domain.

      • hostName is the name of the Administration Server host.

    • domains.0.hosts.0.hostCredType: The credentials for the Administration server. Possible values are Preferred, New, or Named Credentials.

    • domains.0.wlsUserName(optional): If New Credentials are selected, specify the user name here.

    • domains.0.wlsPassword(optional): If New Credentials are selected, specify the password here.

    • domains.0.credName(optional): If Named Credentials are selected, specify the name of the credentials followed by the name of the credential owner in the format <cred_name>:<owner_name>. For example, user1_creds:SYSMAN.
  • Application Details:

    Specify the details of the Java EE applications that are being deployed.
    • javaeeApps.0.appName: where:

      • javaeeApps.0.appName: The name of the Java EE application being deployed. Since multiple applications can be deployed, the index (0) identifies each application being deployed.

      • isSharedLib: Set this flag to true if the application is to be deployed in a shared library.

      • stageMode The stage mode can be Default, Stage, and No Stage.

      • startMode: This can be Full, Admin, or Do not start.

      • retirementPolicy: Set this flag to true if a retirement policy is available.

      • retirementtimeout: Specify the retirement timeout period here.

      • targets: The target(s) on which the applications are to be deployed.

      • archiveSwLibPath: The location in which the archive is stored in the Software Library.

      • archiveFileName: The name of the archive file.

      • archiveStagingLocation: The location in which the archive should be staged on the Administration Server host.

Note:

In the remaining optional sections, you can specify the Software Library path, the file name, and the staging location as necessary.

Undeploying a Java EE Application Using EMCLI

To undeploy a Java EE application using EMCLI, run the following command:

emcli submit_procedure -name="JAVAEE_APPLICATION_UNDEPLOY" -input_file=data="/input-undeploy.properties" 
[instance_name="javaee_undeploy"]

Sample Input File

Description of the Input File

This section shows the format of a sample input-undeploy.properties file.

stopOnError=true
operation=Undeploy

#Host Creds for all the hosts part of the domain
domains.0.domainTargetName=/Farm01_wls1213_njrf_1c1ms/wls1213_njrf_1c1ms
domains.0.wlsCredType=New
domains.0.wlsUserName=weblogic1
domains.0.wlsPassword=welcome1$
#domains.0.credName=wls_creds:SYSMAN

#Host Creds for all the hosts part of the domain
domains.0.hosts.0.hostName=hostname.example.com
domains.0.hosts.0.hostCredType=New
domains.0.hosts.0.hostUserName=user1
domains.0.hosts.0.hostPassword=KDsa0105
#domains.0.hosts.0.hostCredName=user1_creds:SYSMAN

#For each application
domains.0.javaeeApps.0.appName=MyCalendar
#domains.0.javaeeApps.0.isSharedLib=false
#domains.0.javaeeApps.0.stageMode=DEFAULT
#domains.0.javaeeApps.0.startMode=full
#domains.0.javaeeApps.0.retirementPolicy=true
#domains.0.javaeeApps.0.retirementTimeout=0
domains.0.javaeeApps.0.targets=Cluster_1
domains.0.javaeeApps.0.deleteTarget=true

#domains.0.javaeeApps.0.archiveSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.archiveFileName=file.jar
#domains.0.javaeeApps.0.archiveStagingLocation=/my_arch/mystage

# If there is no plan, then this can be skipped
#domains.0.javaeeApps.0.planSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.planFileName=xyz.jar
#domains.0.javaeeApps.0.planStagingLocation=/my_plan/mystage

# If there is no predeploy script, this can be skipped
#domains.0.javaeeApps.0.preDeployScriptSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.preDeployScriptFileName=xyz.py
#domains.0.javaeeApps.0.preDeployScriptStagingLocation=/my_prescript/mystage

# If there is no postdeploy script, this can be skipped
#domains.0.javaeeApps.0.postDeployScriptSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.postDeployScriptFileName=xyz.py
#domains.0.javaeeApps.0.postDeployScriptStagingLocation=/my_postscript/mystage

# If there are no additional scripts, this can be skipped
#domains.0.javaeeApps.0.additionalFiles.0.swLibPath=my_folder/calpp
#domains.0.javaeeApps.0.additionalFiles.0.fileName=additional.zip
#domains.0.javaeeApps.0.additionalFiles.0.stagingLocation=/my_add/mystage

# If there is no target execution script, this can be skipped
#domains.0.javaeeApps.0.targetExecScriptSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.targetExecScriptFileName=tscript.pl
#domains.0.javaeeApps.0.targetExecScriptStagingLocation=/my_exec/mystage
  • stopOnError: Set this flag to true if the deployment procedure should stop when an error is encountered while a Java EE application is being undeployed.

  • operation: The type of operation (Undeploy) being performed.

  • Domain Details: Specify the details of the WebLogic domains on which these applications are being undeployed.

    • domains.0.domainTargetNamewhere:
      • 0 is the index of the domain

      • domainTargetName is the name of the target in Enterprise Manager.

    • domains.0.wlsCredType: The credentials for the domain. Possible values are Preferred , New. or Named Credentials.
    • domains.0.wlsUserName(optional): If New Credentials are selected, specify the user name here.

    • domains.0.wlsPassword(optional): If New Credentials are selected, specify the password here.

    • domains.0.credName (optional): If Named Credentials are selected, specify the name of the credentials followed by the name of the credential owner in the format <cred_name>:<owner_name>. For example, user1_creds:SYSMAN.
  • Host Details:

    Specify the Administration Server host details here.
    • hosts.0.hostName: where:

      • 0 is the index for the Administration Server host. If additional files, and target execution scripts are present, indexes 1, 2, 3, and so on must be used for all the other hosts in the domain.

      • hostName is the name of the Administration Server host.

    • domains.0.hosts.0.hostCredType: The credentials for the Administration Server. Possible values are Preferred, New, or Named Credentials.

    • domains.0.wlsUserName(optional): If New Credentials are selected, specify the user name here.

    • domains.0.wlsPassword(optional): If New Credentials are selected, specify the password here.

    • domains.0.credName(optional): If Named Credentials are selected, specify the name of the credentials followed by the name of the credential owner in the format <cred_name>:<owner_name>. For example, user1_creds:SYSMAN.
  • Application Details:

    Specify the details of the Java EE applications that are being undeployed.
    • javaeeApps.0.appName: where:

      • javaeeApps.0.appName: The name of the Java EE application being undeployed. Since multiple applications can be undeployed, the index (0) identifies each application being deployed.

      • isSharedLib: Set this flag to true if the application being undeployed is present in a shared library.

      • stageMode The stage mode can be Default, Stage, and No Stage.

      • startMode: This can be Full, Admin, or Do not start.

      • retirementPolicy: Set this flag to true if a retirement policy is available.

      • retirementtimeout: Specify the retirement timeout period here.

      • targets: The target(s) from which the applications are to be undeployed.

      • deleteTarget:

        Set this flag to true if the target is to be deleted after the application has been undeployed.
      • archiveSwLibPath: The location in which the archive is stored in the Software Library.

      • archiveFileName: The name of the archive file.

      • archiveStagingLocation: The location in which the archive should be staged on the Administration Server host.

Note:

In the remaining optional sections, you can specify the Software Library path, the file name, and the staging location as necessary.

Redeploying a Java EE Application Using EMCLI

To redeploy a Java EE application using EMCLI, run the following command:
emcli submit_procedure -name="JAVAEE_APPLICATION_REDEPLOYMENT" -input_file=data="/input-redeploy.properties" 
[instance_name="javaee_redeploy"

Sample Input File

stopOnError=true
operation=Redeploy

#Host Creds for all the hosts part of the domain
domains.0.domainTargetName=/Farm01_wls1213_njrf_1c1ms/wls1213_njrf_1c1ms
domains.0.wlsCredType=New
domains.0.wlsUserName=weblogic1
domains.0.wlsPassword=welcome1$
#domains.0.credName=wls_creds:SYSMAN

#Host Creds for all the hosts part of the domain
domains.0.hosts.0.hostName=hostname.example.com
domains.0.hosts.0.hostCredType=New
domains.0.hosts.0.hostUserName=user1
domains.0.hosts.0.hostPassword=KDsa0105
#domains.0.hosts.0.hostCredName=user1_creds:SYSMAN

#For each application
domains.0.javaeeApps.0.appName=MyCalender
domains.0.javaeeApps.0.isSharedLib=false
domains.0.javaeeApps.0.stageMode=DEFAULT
domains.0.javaeeApps.0.startMode=full
domains.0.javaeeApps.0.retirementPolicy=true
domains.0.javaeeApps.0.retirementTimeout=0
domains.0.javaeeApps.0.targets=Cluster_1
#domains.0.javaeeApps.0.deleteTarget=false

domains.0.javaeeApps.0.archiveSwLibPath=demo_folder/calendar_app
domains.0.javaeeApps.0.archiveFileName=Calendar.war
domains.0.javaeeApps.0.archiveStagingLocation=/my_arch/mystage

# If there is no plan, then this can be skipped
#domains.0.javaeeApps.0.planSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.planFileName=xyz.jar
#domains.0.javaeeApps.0.planStagingLocation=/my_plan/mystage

# If there is no predeploy script, this can be skipped
#domains.0.javaeeApps.0.preDeployScriptSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.preDeployScriptFileName=xyz.py
#domains.0.javaeeApps.0.preDeployScriptStagingLocation=/my_prescript/mystage

# If there is no postdeploy script, this can be skipped
#domains.0.javaeeApps.0.postDeployScriptSwLibPath=my_folder/calpp
#domains.0.javaeeApps.0.postDeployScriptFileName=xyz.py
#domains.0.javaeeApps.0.postDeployScriptStagingLocation=/my_postscript/mystage

# If there are no additional scripts, this can be skipped
#domains.0.javaeeApps.0.additionalFiles.0.swLibPath=my_folder/calpp
#domains.0.javaeeApps.0.additionalFiles.0.fileName=additional.zip
#domains.0.javaeeApps.0.additionalFiles.0.stagingLocation=/my_add/mystage

# If there is no target execution script, this can be skipped
#domains.0.javaeeApps.0.targetExecScriptSwLibPath=my_folder/my_script
#domains.0.javaeeApps.0.targetExecScriptFileName=script.pl
#domains.0.javaeeApps.0.targetExecScriptStagingLocation=/my_exec/mystage

Note:

See Deploying a Java EE Application Using EMCLI for details on the input details.