Thursday, February 4, 2010

Deployment Plan

Overriding value using Deployment Plan

We can override the values of the deployement descriptors at the runtime using plan.xml. Following are the steps which can be followed to override context-root of the application specified in the weblogic.xml:

1) My weblogic.xml looks as follows:






I want to change the context-root from virtual to TestApp at runtime.

2) Create a deployment plan using weblogic.PlanGenerator as follows:

java weblogic.PlanGenerator -all -plan Plan.xml Virtual.war

This will generate Plan.xml outside the archived application.

3) Plan.xml contains the values which can be overridden in the deployment descriptor at runtime. We can override the value of context-root at runtime as follows:










4) Now deploy the application using weblogic.Deployer as follows:

java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password weblogic -redeploy -name Virtual -source Virtual.war -targets AdminServer -plan Plan.xml

5) Test the application using the following URL:

http://localhost:7001/TestApp

Default URL of application:
http://localhost:7001/Virtual

At runtime the value of context-root was overridden to TestApp.

No comments:

Post a Comment