10 Deploying Applications to Resource Groups and Templates
Learn about application deployment with resource group templates and domain resource groups, including information about supported deployment clients for performing deployment operations.
Note:
WebLogic Server Multitenant domain partitions, resource groups, and resource group templates are deprecated in WebLogic Server 12.2.1.4.0 and will be removed in the next release.This chapter includes the following sections:
Application Deployment with Resource Group Templates
You can deploy a common set of applications and libraries to resource group templates to simplify application configuration across a domain or domain partitions.
A resource group template is a named, domain-level collection of deployable resources intended to be used as a pattern by (usually) multiple resource groups. When each resource group references the given template, it obtains its own runtime copies of the resources defined in the template. All of the applications and libraries deployed to the resource group template are then deployed to the resource group and available at the domain or partition level.
Note:
WebLogic Server Multitenant domain partitions, resource groups, and resource group templates are deprecated in WebLogic Server 12.2.1.4.0 and will be removed in the next release.Supported Deployment Operations
You can perform the following deployment operations for applications and libraries with resource group templates:
-
deploy
-
undeploy
-
redeploy
-
update
-
distribute
If the operation succeeds, the application or library deploys (or redeploys, undeploys, or so forth) to the targets associated with the referencing resource groups.
You cannot start or stop applications and libraries deployed to resource group templates, as you must perform these operations at the resource group level. Resource group templates merely group a set of applications to share across a domain or partitions. Applications activate in runtime when a resource group references the resource group template and then starts the deployed applications.
Note the following considerations and restrictions for application deployment with resource group templates:
-
When performing deployment operations, you specify the resource group template name with the
resourceGroupTemplate
option. The specified resource group template must exist or the operation fails. -
Application names must be unique within the resource group template.
-
An error occurs if you attempt to specify application-level targets using the
targets
option when performing deployment operations at the resource group template level. You cannot target individual applications deployed to a resource group template, as the application uses the targets associated with the referencing resource groups. -
If you delete an application from a resource group template that multiple resource groups reference, then the application is also removed from all referencing resource groups. Any application overrides performed at the resource group level are also removed.
-
If undeploying a versioned application or library from a resource group template, you must specify the version-related options. If only one version of the deployed application or library exists, then these options are optional.
Available Deployment Clients
You can use any of the following deployment clients to perform deployment operations with resource group templates. Specify the resource group template with the resourceGroupTemplate
option, as shown in the provided examples.
-
Maven plug-in goals for deployment
mvn com.oracle.weblogic:weblogic-maven-plugin:deploy -Dname=<application_name> -DresourceGroupTemplate=<resource_group_template_name> -Dsource=<path_to_application>
-
java weblogic.Deployer -deploy -name <application_name> -resourceGroupTemplate <resource_group_template_name> path_to_application
-
<wldeploy action="deploy" name=<application_name> resourceGroupTemplate=<resource_group_template_name> source=<path_to_application> />
-
deploy(appName=<application_name>, resourceGroupTemplate=<resource_group_template_name>,path=<path_to_application>)
Additionally, you can use the WebLogic Server Administration Console or Fusion Middleware Control to perform deployment operations with resource group templates. See the following online help topics:
-
Administration Console
-
Fusion Middleware Control
For information about deploying applications to resource group templates in a multittenant environment, including WLST examples, see Deploying Applications to Resource Group Templates in Using WebLogic Server MT.
Application Deployment with Domain Resource Groups
You can deploy applications and libraries to a resource group and perform deployment operations on those applications, including start and stop.
A resource group is a named collection of deployable resources, such as Java EE applications and the data sources, JMS artifacts, and other resources that the applications use. Resource groups conveniently group together Java EE applications and their resources into a distinct administrative unit and can be defined at the domain level or be specific to a domain partition. A resource group can either contain resources directly or reference a resource group template containing the resources. If a resource group references a resource group template, and you need to customize the configuration for an application, you can override the default template application configuration. For general information about resource groups, see Configuring Resource Groups in Using WebLogic Server MT.
You can deploy applications and libraries to a resource group at the domain or partition level. The resources and applications in a resource group are "fully qualified," in that you provide all of the necessary information to start or connect to those resources. All of the applications deployed to a resource group use the targets associated with that resource group
Note:
WebLogic Server Multitenant domain partitions, resource groups, and resource group templates are deprecated in WebLogic Server 12.2.1.4.0 and will be removed in the next release.Supported Deployment Operations
You can perform the following deployment operations for applications and libraries with domain resource groups:
-
deploy
-
undeploy
-
redeploy
-
update
-
distribute
-
start
-
stop
If the operation succeeds, the application or library deploys (or redeploys, starts, or so forth) to the targets associated with the specified domain resource group.
Note the following considerations for application deployment with domain resource groups:
-
Application names must be unique within the domain.
-
For
deploy
anddistribute
operations, you must specify the resource group name with theresourceGroup
option.For other deployment operations, you do not specify the
resourceGroup
option. WebLogic Server derives the resource group from the unique application name. If the specified resource group does not exist, or you do not specify theresourceGroup
option if required, then the deployment operation fails. -
The deployment operation fails if you specify the
targets
option when performing deployment operations for applications at the resource group level. You cannot target individual applications in the resource group, as applications use the targets for the resource group -
Resource groups can inherit resource and application configuration from a resource group template. If a resource group references a resource group template, any applications or libraries deployed to the resource group template are immediately deployed to the referencing resource group.
If needed, you can override the default resource group template application configuration to customize a particular application in a resource group. See Overriding Application Configuration.
Available Deployment Clients
You can use any of the following deployment clients to perform deployment operations with domain resource groups. For deploy
and distribute
operations only, specify the resource group name with the resourceGroup
option, as shown in the provided examples. If one and only one resource group exists in the domain, the resourceGroup
option is optional.
-
Maven plug-in goals for deployment
mvn com.oracle.weblogic:weblogic-maven-plugin:deploy -Dname=<application_name> -DresourceGroup=<resource_group_name> -Dsource=<path_to_application>
-
java weblogic.Deployer -deploy -name <application_name> -resourceGroup <resource_group_name> path_to_application
-
<wldeploy action="deploy" name=<application_name> resourceGroup=<resource_group_name> source=<path_to_application> />
-
deploy(appName=<application_name>, resourceGroup=<resource_group_name>,path=<path_to_application>)
Additionally, you can use the WebLogic Server Administration Console or Fusion Middleware Control to perform deployment operations with domain resource groups. See the following online help topics:
-
Administration Console
-
Fusion Middleware Control
Overriding Application Configuration
A resource group can reference a resource group template to obtain its own runtime copy of the resources and applications defined in the resource group template. Because the resource group inherits the application configuration defined in the resource group template, you do not need to manually deploy and configure each application. Applications and libraries deployed to a resource group template are immediately deployed to the referencing resource group (or undeployed, redeployed, and so forth, depending on the performed deployment operation).
If you need to customize a particular application in a resource group, you can override the default resource group template application configuration. If multiple resource groups reference the same resource group template, ensure you override the application configuration for all necessary resource groups.
-
Create a different deployment plan to use for the application you want to customize.
-
In the new deployment plan, define the values for the attributes you want to override from the template configuration for that application.
-
Specify the new override deployment plan using one of the following methods:
-
Administration Console
See Override application configuration in Oracle WebLogic Server Administration Console Online Help.
-
Fusion Middleware Control
See Override application configuration in Administering Oracle WebLogic Server with Fusion Middleware Control.
-
To override only dynamic attributes for an application, specify the override deployment plan by using the update command with one of the supported deployment clients.
The following example uses weblogic.Deployer. The first line shows the application deployed to the resource group template that the resource group references. The second line shows overriding the deployment plan path for the application using the update command. Note that the second line does not specify a resource group, as WebLogic Server derives the resource group from the unique application name.
java weblogic.Deployer -deploy -name application1 -plan /apps/application1/plan.xml -resourceGroupTemplate myResourceGroupTemplate java weblogic.Deployer -update -name application1 -plan /apps/application1/override-plan.xml
The application or module then redeploys using the new deployment plan for its application configuration.
-
Removing an Application Override
If you no longer need to customize a particular application in a resource group, you can remove an application override by removing the deployment plan containing the overridden attributes. The application configuration returns to the default configuration defined in the resource group template.
Use one of the following methods to remove an existing application override:
-
Administration Console
See Override application configuration in Oracle WebLogic Server Administration Console Online Help.
-
Fusion Middleware Control
See Remove application configuration overrides in Administering Oracle WebLogic Server with Fusion Middleware Control.
-
To remove existing overrides for dynamic attributes only, use the
update
command with one of the supported deployment clients and specify theremovePlanOverride
option. For example:java weblogic.Deployer -update -name application1 -removePlanOverride
-
To remove existing overrides for dynamic and non-dynamic attributes, use the
redeploy
command with one of the supported deployment clients and specify theremovePlanOverride
option. For example:java weblogic.Deployer -redeploy -name application1 -removePlanOverride
Note that the example does not specify a resource group, as the resource group is derived from the unique application name.
The application or module then redeploys with the application override removed, and the application uses its default configuration.