Deploying WLDF Application Modules 14-3
If you want to reconfigure an application that was deployed without a deployment plan, you must undeploy, unarchive, reconfigure, re-archive, and then redeploy the
application. With a configuration plan, you can dynamically change many configuration options simply by updating the plan, without modifying the application
archive.
If you enable a feature called hot swap see Section 14.6, Enabling Hot-Swap
Capabilities before deploying your application with a deployment plan, you can
dynamically update all instrumentation settings without redeploying the application. If you do not enable hot swap, or if you do not use a deployment plan, changes to
some instrumentation settings require redeployment, as shown in Table 14–2
.
You can use a deployment plan to dynamically update configuration elements without redeploying the application.
■
enabled
■
dye-filtering-enabled
■
dye-mask
■
action
14.3 Using a Deployment Plan: Overview
The general process for creating and using a deployment plan is as follows:
1.
Create a well-formed weblogic-diagnostics.xml descriptor file for the application. It is recommended that you create an empty descriptor. That provides full
flexibility for dynamically modifying the configuration. It is possible to create monitors in the original descriptor file and then use a deployment plan to override
the settings. You will, however, be unable to completely remove monitors without redeploying. If you add monitors using a deployment plan to an empty descriptor,
all such monitors can be removed. For information about configuring diagnostic application modules, see
Section 11.5, Configuring Application-Scoped Instrumentation.
The schema for weblogic-diagnostics.xml is available at http:xmlns.oracle.comweblogicweblogic-diagnostics1.0web
logic-diagnostics.xsd .
2.
Place the descriptor file weblogic-diagnostics.xml, in the top-level META-INF directory of the appropriate archive.
Table 14–2 When Application Instrumentation Configuration Changes Take Effect
Scenario Settings to Use = Add and
remove monitors
Attach and detach actions
Enable and disable monitors
Application deployed with a deployment plan, hot swap enabled
Dynamic Dynamic
Dynamic Application deployed with a
deployment plan, hot swap not enabled
Must redeploy application
1
1
If hot-swap is not enabled, you can remove a monitor, but that just disables it. The instrumentation code is still woven into the application code. You cannot re-enable it through a modified plan.
Dynamic Dynamic
Application deployed without a deployment plan
Must redeploy application
Must redeploy application
Must redeploy application
14-4 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server
3.
Create a deployment plan, for example by using weblogic.PlanGenerator. See Section 14.4, Creating a Deployment Plan Using weblogic.PlanGenerator.
4.
Start the server, optionally enabling hot-swap capability. See Section 14.6,
Enabling Hot-Swap Capabilities.
5.
Deploy the application using the deployment plan. See Section 14.7, Deploying an
Application with a Deployment Plan .
6.
When needed, edit the plan and update the application with the plan. See Section 14.8, Updating an Application with a Modified Plan.
14.4 Creating a Deployment Plan Using weblogic.PlanGenerator
You can use the weblogic.PlanGenerator tool to create an initial deployment plan, and interactively override specific properties of the weblogic-diagnostics.xml descriptor.
The PlanGenerator tool inspects all J2EE deployment descriptors in the selected application, and creates a deployment plan with null variables for all relevant
WebLogic Server deployment properties that configure external resources for the application.
To create the plan, use the following syntax: java weblogic.PlanGenerator -plan output-plan.xml [options]
application-path For example:
java weblogic.PlanGenerator -plan foo.plan -dynamics testappsmywar
For more information about creating and using deployment plans, see Configuring Applications for Production Deployment in Deploying Applications to Oracle WebLogic
Server.
For more information about using PlanGenerator, see weblogic.PlanGenerator Command Line Reference and Exporting an Application for Deployment to New
Environments in Deploying Applications to Oracle WebLogic Server
14.5 Sample Deployment Plan for Diagnostics