12 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 12-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:
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 / 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.properties
file.
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.domainTargetName
where:-
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.domainTargetName
where:-
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
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.