Hi,

Jay SenSharma

Jay SenSharma

As a WebLogic Administrator Many times we want to make some changes in the application provided by the Development team. But it is not good for a WebLogic Administrator to make changes in the application archieve provided by the Application Development team. But to fulfill some environmental requirements the Administartor has to make some changes in the application.

WebLogic provides a best way for the WebLogic Administrators to alter the different Tags present inside the Application deployment descriptors like adding a new Tag or replacing a value of a Tag mentioned in the “web.xml” or in “weblogic.xml” or in any of the deployment descriptor like “weblogic-ejb-jar.xml”,”application.xml”, “weblogic-application.xml”…etc.

In this example we are going to see how can we change the <session-timeout> of a Web Application without even altering the “web.xml” physically…On the fly

Step1). Deploy your Application as it is at present on the Server. Suppose your Web Application name is “SessionTimeoutWebApp” (I am assuming it as a Exploded WAR file you can work with Archived WAR file as well in the same way)

Step2). Anywhere in your file system Just paste the following “plan.xml” file: (Suppose Location is “F:SessionTimeout_PlanDemo” )

<?xml version='1.0' encoding='UTF-8'?>
<deployment-plan xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-deployment-plan.xsd" global-variables="false">

   <application-name>SessionTimeoutWebApp</application-name>     <!-- You need to change this Line and Put your Web Application Name -->
	<variable-definition>
		<variable>
			<name>NewSessionValue</name>
			<value>100000</value>
		</variable>
	</variable-definition>

   <module-override>
	<module-name>SessionTimeoutWebApp</module-name>      <!-- You need to change this Line and Put your Web Application Name -->
	<module-type>war</module-type>
	<module-descriptor external="true">
		<root-element>web-app</root-element>
		<uri>WEB-INF/web.xml</uri>
		<variable-assignment>
			<name>NewSessionValue</name>
			<xpath>/web-app/session-config/session-timeout</xpath>
		</variable-assignment>
	</module-descriptor>
    </module-override>
    <config-root>F:SessionTimeout_PlanDemo</config-root>  <!-- You need to change this Line and Put the location of plan.xml file wherever u have pasted it -->
</deployment-plan>

Step3). Login to AdminConsole and goto deployments page—-> the select your Application (After Pressing Lock & Edit Button) –> update (click this button)—> browse your “plan.xml” file location and then finish.
Once the changes will be activated ….Next time your will see that your <session-timeout> value is changed  from the AdminConsole or through any other technique like JMX or WLST.

.
.
Thanks
Jay SenSharma

If you enjoyed this post, please considerleaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.