This post is an illustration of usage of plan.xml for overriding features of Message Driven Bean application dynamically.
Administrators use deployment plans to easily change an application’s WebLogic Server configuration for a specific environment without modifying existing Java EE or WebLogic-specific deployment descriptors. Multiple deployment plans can be used to reconfigure a single application for deployment to multiple, differing WebLogic Server environments.
In the plan.xml we will override the specified in the element tag of the weblogic-ejb-jar.xml file.
Steps to be followed:-
1:- Create a MDB listening to the Queue with the specified in the weblogic-ejb-jar.xml file.
2:- Generate the plan.xml file using the weblogic.PlanGenerator.
Ex:- java weblogic.PlanGenerator D:\ TestApp\TestMDB.jar –configurables
Once the plan.xml file is generated we can override the value for the provider-url as below.
<variable> <name>MessageDrivenDescriptor_ProviderUrl_125717420773411</name> <value>t3://localhost:7001</value> </variable>
After overriding the value from the plan.xml, run the weblogic.Deployer command to deploy the application specifying the deployment plan as below.
java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password weblogic -deploy -name TestAPP -source D:\TestAPP.ear -targets AdminServer -stage -plan D:\plan.xml
This would override the dynamically, not requiring to manually edit the weblogic-ejb-jar.xml.
Hope the post is helpful for those who would like to use the same archive files for different environments overcoming the tedious job of manually editing the deployment descriptors.
I have uploaded the sample application as well for further references.
Wonders Team. 🙂