Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-135570

ClassNotFoundException is thrown during session replication while loading persisted sessions

    Details

      Description

      Step reproduce:

      1. Activate session replication at tomcat level for both tomcat:
        1. Add this property to $TOMCAT_HOME/conf/server.xml of each node, and inside <Engine> tag:
          <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
        2. Add the following properties to $TOMCAT_HOME/conf/context.xml of each node and inside Context tag:
          <Manager className="org.apache.catalina.ha.session.DeltaManager"
           expireSessionsOnShutdown="false"
           notifyListenersOnReplication="true"/>
        3. Edit $TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml and immediately following the <web-app> tag (inside the tag), add the tag
          <distributable />
        4. Edit $TOMCAT_HOME/conf/logging.properties and add the following lines.
          ##CLUSTER LOG
           5cluster.org.apache.juli.AsyncFileHandler.level = FINER
           5cluster.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
           5cluster.org.apache.juli.AsyncFileHandler.prefix = cluster.
           # just the clustering logs - all others are stock logging.properties
           org.apache.catalina.tribes.MESSAGES.level = FINE
           org.apache.catalina.tribes.MESSAGES.handlers = 5cluster.org.apache.juli.AsyncFileHandler
          
          org.apache.catalina.tribes.level = FINE
           org.apache.catalina.tribes.handlers = 5cluster.org.apache.juli.AsyncFileHandler
          
          org.apache.catalina.ha.level = FINE
           org.apache.catalina.ha.handlers = 5cluster.org.apache.juli.AsyncFileHandler
          
          org.apache.catalina.ha.deploy.level = INFO
           org.apache.catalina.ha.deploy.handlers = 5cluster.org.apache.juli.AsyncFileHandler
      2. Also, add "5cluster.org.apache.juli.AsyncFileHandler" into $TOMCAT_HOME/conf/logging.properties to the handlers line at the beginning of the file.
      3. Set "portlet.session.replicate.enabled=true" in portal-ext.properties
      4. Start first tomcat node and wait until startup finish
      5. Verify you can login from browser using URL: http://localhost:8080/web/guest
      6. Start second tomcat node and wait until startup finish
      7. Review LIFERAY_HOME/tomcat-9.0.43/logs/cluster.*.log files of both nodes

      Expected result:
      No error in the cluster.*.log files of both nodes.
      Actual result:
      The error is thrown in the cluster.*.log file in the second node.

      SEVERE [Tribes-Task-Receiver[Catalina-Channel]-3] org.apache.catalina.ha.session.DeltaManager.deserializeSessions ClassNotFoundException while loading persisted sessions: [java.lang.ClassNotFoundException: com.liferay.portal.kernel.util.TransientValue]
      	java.lang.ClassNotFoundException: com.liferay.portal.kernel.util.TransientValue
      		at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
      		at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
      		at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
      		at java.lang.Class.forName0(Native Method)
      		at java.lang.Class.forName(Class.java:348)
      		at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:756)
      		at org.apache.catalina.tribes.io.ReplicationStream.resolveClass(ReplicationStream.java:79)
      		at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1984)
      		at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1848)
      		at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2158)
      		at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1665)
      		at java.io.ObjectInputStream.readObject(ObjectInputStream.java:501)
      		at java.io.ObjectInputStream.readObject(ObjectInputStream.java:459)
      		at org.apache.catalina.ha.session.DeltaSession.doReadObject(DeltaSession.java:853)
      		at org.apache.catalina.ha.session.DeltaSession.readObjectData(DeltaSession.java:632)
      		at org.apache.catalina.ha.session.DeltaManager.deserializeSessions(DeltaManager.java:676)
      		at org.apache.catalina.ha.session.DeltaManager.handleALL_SESSION_DATA(DeltaManager.java:1372)
      		at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1217)
      		at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:980)
      		at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:77)
      		at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:788)
      		at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:771)
      		at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:335)
      		at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91)
      		at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91)
      		at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:117)
      		at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91)
      		at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:274)
      		at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:261)
      		at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:216)
      		at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:101)
      		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      		at java.lang.Thread.run(Thread.java:748)
      13-Jul-2021 15:57:44.224 SEVERE [Tribes-Task-Receiver[Catalina-Channel]-3] org.apache.catalina.ha.session.DeltaManager.messageReceived Manager [localhost#]: Unable to receive message through TCP channel
      	java.lang.ClassNotFoundException: com.liferay.portal.kernel.util.TransientValue
      		at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
      		at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
      		at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
      		at java.lang.Class.forName0(Native Method)
      		at java.lang.Class.forName(Class.java:348)
      		at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:756)
      		at org.apache.catalina.tribes.io.ReplicationStream.resolveClass(ReplicationStream.java:79)
      		at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1984)
      		at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1848)
      		at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2158)
      		at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1665)
      		at java.io.ObjectInputStream.readObject(ObjectInputStream.java:501)
      		at java.io.ObjectInputStream.readObject(ObjectInputStream.java:459)
      		at org.apache.catalina.ha.session.DeltaSession.doReadObject(DeltaSession.java:853)
      		at org.apache.catalina.ha.session.DeltaSession.readObjectData(DeltaSession.java:632)
      		at org.apache.catalina.ha.session.DeltaManager.deserializeSessions(DeltaManager.java:676)
      		at org.apache.catalina.ha.session.DeltaManager.handleALL_SESSION_DATA(DeltaManager.java:1372)
      		at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1217)
      		at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:980)
      		at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:77)
      		at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:788)
      		at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:771)
      		at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:335)
      		at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91)
      		at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91)
      		at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:117)
      		at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91)
      		at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:274)
      		at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:261)
      		at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:216)
      		at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:101)
      		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      		at java.lang.Thread.run(Thread.java:748)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              victor.ware Victor Ware
              Reporter:
              koor.gai Koor Gai
              Participants of an Issue:
              Recent user:
              Sophia Zhang
              Engineering Assignee:
              Tina Tian
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 week, 5 days ago

                  Packages

                  Version Package
                  7.4.3.4 CE GA4
                  7.4.13 DXP GA1
                  Master