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

Tuesday, January 26, 2010

11g virtual dir url pattern is not identified correctly

<virtual-directory-mapping>

<local-path>x:/test/vdir</local-path>

<url-pattern>/test/*</url-pattern>

</virtual-directory-mapping>

Solution
1. Create directory name test and put ur file in that directory

The directory should be created at this path x:/test/vdir. But do not specify the test directory in your local-path.

<virtual-directory-mapping>

<local-path>x:/test/vdir</local-path>

<url-pattern>/test/*</url-pattern>

</virtual-directory-mapping>

Test URL : http://hostname:port/testapp/test/mypage.pdf





Thursday, January 21, 2010

Deploying ADF application to weblogic

http://jonathantcone.wordpress.com/2010/01/08/deploying-adf-11-to-wls-10/

http://www.freewebalbum.com/blogs/faces/bjanko/blogs.jsp?blog=bjanko20090127130431


Mapping URLs to file location in weblogic

You can map your URL to file location by specifying the file location in configuration file.

Weblogic.xml
<virtual-directory-mapping>
<local-path> path to file</local-path>
<url-pattern>/*</url-pattern>
</virtual-directory-mapping>