4-10 Deploying Applications to Oracle WebLogic Server
1.
Start the examples server WebLogic server by using the Windows start menu or by running the WL_HOME\samples\domains\wl_server\startWebLogic.cmd
script.
2.
Access the Administration Console by pointing your browser to http:localhost:7001console.
3.
Log in to the Administration Console.
4.
Follow the steps in Install applications and modules in Oracle WebLogic Server Administration Console Help to install your application or the
jspExpressionEar.ear sample application you downloaded in Section 4.3.1,
Preparing the Deployment Files .
4.3.2.1 Saving Configuration Changes to a Deployment Plan
Use the Administration Console to edit deployment configuration properties for the application you installed in
Section 4.3.2, Installing the Application Archive and save
the configuration to a deployment plan. For example, you could change properties such as the following in the jspExpressionEar.ear sample application:
1. On the Configuration page, edit one or more configuration properties. For
example, change the Session Invalidation Interval to 80 seconds, and the Session Timeout to 8000 seconds.
2. Click Save to save your changes. The Administration Console stores your
configuration changes to a new deployment plan. If you deployed the sample application from a root directory, the Administration Console automatically places
the new deployment plan in the \plan subdirectory of the root directory. For example, c:\sample_root\plan\Plan.xml.
4.4 Understanding Deployment Plan Contents
The deployment plan generated in Section 4.3, Creating a New Deployment Plan to
Configure an Application contains the entries shown in
Section 4–1, Sample Deployment Plan
.
Example 4–1 Sample Deployment Plan
deployment-plan xmlns=http:www.bea.comnsweblogic90 application-namesample_rootapplication-name
variable-definition variable nameSessionDescriptor_InvalidationIntervalSecs_11029744771850name
value80value variable
variable nameSessionDescriptor_TimeoutSecs_11029744772011name
value8000value variable
variable-definition module-override
module-namejspExpressionEar.earmodule-name module-typeearmodule-type
module-descriptor external=false root-elementweblogic-applicationroot-element
uriMETA-INFweblogic-application.xmluri module-descriptor
module-descriptor external=false root-elementapplicationroot-element
uriMETA-INFapplication.xmluri
Configuring Applications for Production Deployment 4-11
module-descriptor module-override
module-override module-namejspExpressionWarmodule-name
module-typewarmodule-type module-descriptor external=false
root-elementweblogic-web-approot-element uriWEB-INFweblogic.xmluri
variable-assignment nameSessionDescriptor_InvalidationIntervalSecs_11029744771850name
xpathweblogic-web-appsession-descriptorinvalidation-interval-secsxpath variable-assignment
variable-assignment nameSessionDescriptor_TimeoutSecs_11029744772011name
xpathweblogic-web-appsession-descriptortimeout-secsxpath variable-assignment
module-descriptor module-descriptor external=false
root-elementweb-approot-element uriWEB-INFweb.xmluri
module-descriptor module-override
module-override module-namesample_rootmodule-name
module-typeearmodule-type module-descriptor external=false
root-elementweblogic-applicationroot-element uriMETA-INFweblogic-application.xmluri
module-descriptor module-descriptor external=false
root-elementapplicationroot-element uriMETA-INFapplication.xmluri
module-descriptor module-override
config-rootC:\sample_root\planconfig-root deployment-plan
The basic elements in the deployment plan serve the following functions:
■
deployment-plan encapsulates all of the deployment plans contents.
■
application-name corresponds to the deployment name for the application or module.
■
variable-definition defines one or more variable elements. Each variable defines the name of a variable used in a plan and a value to assign
which can be null. The sample plan shown in Section 4–1, Sample Deployment
Plan contains variable definitions for the changes you made to the Session
Invalidation Interval and Session Timeout properties.
■
module-override elements define each module name, type, and deployment descriptor that the deployment plan overrides. A module-descriptor element
can optionally contain a variable-assignment which identifies a variable name used to override a property in the descriptor, and the exact location within
the descriptor where the property is overridden.
The sample plan shown in Section 4–1, Sample Deployment Plan
contains module override elements for the Enterprise application, the embedded Web
application, and the enclosing root directory. The module-descriptor entry for the weblogic.xml descriptor file contains two variable-assignment elements
that override the property values for the Session Invalidation Interval and Session
4-12 Deploying Applications to Oracle WebLogic Server
Timeout properties you changed in Section 4.3.2.1, Saving Configuration Changes
to a Deployment Plan .
By default, the values in variable-assignment elements are added to the values that are already defined in the descriptor. You can change this behavior and
cause the variable-assignment element to replace or remove the values that are defined in the descriptor by setting the operation sub-element in the
variable-assignment element to the value replace or remove, respectively.
For example, suppose that in ejb-jar.xml, a developer created a policy to allow access only to the security role named ejbRole.
... assembly-descriptor
security-role role-nameejbRolerole-name
security-role method-permission
role-nameejbRolerole-name method
ejb-nameejb.SearchHandlerWrapperEJBejb-name method-namemethod-name
method method-permission
assembly-descriptor ...
And, the security-role-assignment element in weblogic-ejb-jar.xml, ejbRole is mapped to the principal named user1.
... security-role-assignment
role-nameejbRolerole-name principal-nameuser1principal-name
security-role-assignment ...
If you want to use a deployment plan to override the security-role-assignment element defined in weblogic-ejb-jar.xml, so that
ejbRole is mapped to user2 instead of user1, you could achieve the desired override behavior by setting appropriate values for the variable,
variable-assignment, and operation elements in the deployment plan. Make sure to set the value of operation to replace:
... variable nameSecurityRoleAssignment_ejbRole_PrincipalNames_
11168815313911name valueuser2value
variable
variable-assignment nameSecurityRoleAssignment_ejbRole_PrincipalNames_11168815313911name
xpathweblogic-ejb-jarsecurity-role-assignment[role-name=ejbRole]princip al-namexpath
operationreplaceoperation variable-assignment
For more information about the contents of a WebLogic Server deployment plan, see http:xmlns.oracle.comweblogicdeployment-plan1.0deployment-
plan.xsd .
Configuring Applications for Production Deployment 4-13
4.5 Using an Existing Deployment Plan to Configure an Application