Saturday, November 28, 2009

Plan.xml usage for Message Driven Bean

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.
    
   MessageDrivenDescriptor_ProviderUrlname>
   t3://localhost:7001value>
    
The corresponding mapping is done as below.
    
  MessageDrivenDescriptor_ProviderUrlname> /weblogic-ejb-jar/weblogic-enterprise-bean
/[ejb-name="TestMDB"]/message-driven-descriptor/provider-url
 
    
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.
 
http://www.4shared.com/file/161924469/59a49461/Planxml-Usage.html
 
Any feedback or queries would be highly appreciated.
 
Please refer the below blog for some great stuff related to WebLogic Security.
 
http://secure-zone.blogspot.com/
 
References:-
 
http://download.oracle.com/docs/cd/E13222_01/wls/docs90/deployment/wlplangenerator.html

1 comment:

  1. Anand, This blog requires some amendments.Specially after weblogic.PlanGenerator command example.
    I was not able to proceed further because i couldn' get what exactly you are trying to say.

    Hoping this would be resolved soon so that i can try this at my end.

    ReplyDelete