Saturday, January 30, 2010

Weblogic Deployment Plan

In weblogic for an application a plan can be setup using plan.xml

How to create plan.xml
1. Open application that was deployed using weblogic console
2. Open configuration tab and make changes. Any changes made to configuration of the application will create plan.xml.
3. It will prompt the location of the Plan.xml.

How does it look like and how does it work ?
Here is a sample of a plan.xml :
<?xml version='1.0' encoding='UTF-8'?>
<deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
<application-name>app</application-name>

<variable-definition>

<variable>

<name>SessionDescriptor_invalidationIntervalSecs_12648285993120</name>

<value>59</value>

</variable>

<variable>

<name>mypath</name>

<value>C:\Documents and Settings\ram\My Documents</value>

</variable>

</variable-definition>

<module-override>

<module-name>TestWeblogicPlan_application1.ear</module-name>

<module-type>ear</module-type>

<module-descriptor external="false">

<root-element>weblogic-application</root-element>

<uri>META-INF/weblogic-application.xml</uri>

<variable-assignment>

<name>SessionDescriptor_invalidationIntervalSecs_12648285993120</name>

<xpath>/weblogic-application/session-descriptor/invalidation-interval-secs</xpath>

</variable-assignment>

</module-descriptor>

<module-descriptor external="false">

<root-element>application</root-element>

<uri>META-INF/application.xml</uri>

</module-descriptor>

<module-descriptor external="true">

<root-element>wldf-resource</root-element>

<uri>META-INF/weblogic-diagnostics.xml</uri>

</module-descriptor>

</module-override>

<module-override>

<module-name>TestWeblogicPlan_ViewController_webapp1.war</module-name>

<module-type>war</module-type>

<module-descriptor external="true">

<root-element>weblogic-web-app</root-element>

<uri>WEB-INF/weblogic.xml</uri>

<variable-assignment>

<name>mypath</name>

<xpath>/weblogic-web-app/virtual-directory-mapping/local-path</xpath>

</variable-assignment>

</module-descriptor>

<module-descriptor external="false">

<root-element>web-app</root-element>

<uri>WEB-INF/web.xml</uri>

</module-descriptor>

</module-override>

<config-root>C:\TGDev\Products\Oracle\Middleware\user_projects\domains\OWCS_domain\servers\AdminServer\upload\TestWeblogicPlan_application1</config-root>

</deployment-plan>



As you can see XPath is used to qualify the path of the attribute to update. For instance, here it's "/weblogic-web-app/session-descriptor/timeout-secs".

You will notice that the XPath indicated is simply the path to that attribute in the following weblogic.xml deployment descriptor.


The changes in Plan.xml will take effect only after update of the application and restart of the domain.



Note: specify your changes in the overide tag of plan.xml. With the plan.xml you can set values to weblogic.xml and weblogic-application.xml

2 comments:

  1. Hi Ram,
    I tried to use deployment plan to specify virtual-directory-mapping but it didn't work. Did you define a in weblogic.xml? Have you tested after restarting the domain?

    ReplyDelete
  2. Hi Ram,
    i have a ADF Application with external WebServices , and i dont know how to change de endpoint when my app goes from developemnt to producction servers

    i hope you can help me

    ReplyDelete