Setting Up Session Replication in Weblogic With Liferay Portal

This article outlines how to set up session replication using Weblogic with Liferay Portal.

Resolution

  1. Open the Liferay Portal .war using an unzip editor.
  2. Navigate to the file: /WEB-INF/weblogic.xml
  3. Add this code in the section.
    <session-descriptor>
        <persistent-store-type>async-replicated-if-clustered</persistent-store-type>
    
  4. The weblogic.xml file should look something like this for Weblogic 10.3.6 and later:
    <xml version="1.0"?>
    
    <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
    	<jsp-descriptor><keepgenerated>true</keepgenerated><page-check-seconds>60</page-check-seconds><precompile>true</precompile><precompile-continue>true</precompile-continue>
    	</jsp-descriptor>
    	<container-descriptor>
    		<prefer-application-packages>package-name>org.mozilla.*
    		</prefer-application-packages>
    		<optimistic-serialization>true</optimistic-serialization>
    		<show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    	</container-descriptor>
    	<session-descriptor>
    		<persistent-store-type>async-replicated-if-clustered</persistent-store-type>
    	</session-descriptor>
    	<context-root>/</context-root>
    </weblogic-web-app>
    
  5. Save the file.
  6. Deploy the war to Weblogic Application Server.
  7. Repeat these steps for each node.

If using Weblogic 10.3.2 or older, Liferay Portal must use prefer-web-inf-classes instead of the prefer-application-packages.

Users must follow the additional steps below before deploying the portal .war to the application server:

  1. In the weblogic.xml file's section, replace the prefer-application-packages with the following:
    <prefer-web-inf-classes>true
  2. Delete the following jars in the WEB-INF/lib:
    • jaxrpc.jar
    • stax.jar
    • wstx.jar
    • xml-apis.jar
  3. Deploy the modified war to the application server.
  4. Repeat these steps for each node.

Load Balancing

Ideally, clusters are best optimized with a load balancer. However, setting a load balancer is beyond the purview of this article and Liferay Support. Users can find documentation on load balancers from the vendor of the web servers such as Apache.

 

 

Was this article helpful?
0 out of 0 found this helpful