This article outlines how to set up session replication using Weblogic with Liferay Portal.
Resolution
- Open the Liferay Portal
.warusing an unzip editor. - Navigate to the file:
/WEB-INF/weblogic.xml - Add this code in the section.
<session-descriptor> <persistent-store-type>async-replicated-if-clustered</persistent-store-type> - The
weblogic.xmlfile 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>
- Save the file.
- Deploy the war to Weblogic Application Server.
- 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:
- In the
weblogic.xmlfile's section, replace theprefer-application-packageswith the following:<prefer-web-inf-classes>true
- Delete the following jars in the
WEB-INF/lib:jaxrpc.jarstax.jarwstx.jarxml-apis.jar
- Deploy the modified war to the application server.
- 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.