Expand my Community achievements bar.

AEM Tomcat cluster

Avatar

Level 4

I've deployed AEM as a war in the Tomcat server and setup a cluster of tomcat instances. In the cluster, there are 3 instances of Tomcat with AEM setup where the AEM instances share nothing among them. EachTomcat instance is configured to replicate session data with other cluster nodes using the "DeltaManager" - OOTB Tomcat replication manager. I've also setup an Apache Httpd sever at the webserver tier to balance the load between each of these nodes.

My issue is that I'm not able to get the session data to replicate between the nodes - in my case the session data happens to be a java POJO class (that implements serializable interface).

When trying to debug the issue there are a few questions that I have around how AEM and a web application server work together. Hope some one here can help.

In my scenario the session data replication between the nodes failed because of "ClassNotFound" exception for the session data class (UserProfileInfo.java). Is this because the class is available in an OSGI bundle that is deployed in the Felix container? Suspecting that it was the issue, I included the path of the bundle that had this class in the classpath and then I started getting the "ClassCastException". This could be because the classloader (OSGI bundle classloader) that loads the class in the OSGI container and the classloader (Tomcat classloader) that loads the class from the classpath are different. 

So how do I get Tomcat to recognize a class that is part of an OSGI bundle and replicate it to the other nodes in the cluster in case of a failover? Deploying AEM on an application server is a pretty common use case so I'm hoping someone here has some idea on this issue

0 Replies