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

java.lang.ClassNotFoundException: org.eclipse.equinox.http.servlet.internal.servlet.HttpSessionAdaptor$ParentSessionListener is thrown in case of having a tomcat cluster with session replication

    Details

      Description

      java.lang.NoClassDefFoundError is thrown in case of having a tomcat cluster with session replication with session replication activated:

      09-May-2017 08:10:56.974 SEVERE [Tribes-Task-Receiver-3] org.apache.catalina.ha.session.DeltaManager.messageReceived Manager [localhost#]: Unable to receive message through TCP channel
       java.lang.ClassNotFoundException: org.eclipse.equinox.http.servlet.internal.servlet.HttpSessionAdaptor$ParentSessionListener
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:348)
      	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:628)
      	at org.apache.catalina.tribes.io.ReplicationStream.resolveClass(ReplicationStream.java:80)
      	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)

      Steps to reproduce - environment setup

      1. Configure Liferay cluster with two tomcat nodes.
      2. Edit $TOMCAT_HOME/conf/server.xml of each node and configure the tcp ports to "8080" and "8180"
      3. Activate session replication at tomcat level:
        1. Edit $TOMCAT_HOME/conf/server.xml of each node and inside Engine tag, add following text:
          <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
          
        2. Edit $TOMCAT_HOME/conf/context.xml of each node and inside Context tag, add following text:
              <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
          
        5. Also add 5cluster.org.apache.juli.AsyncFileHandler to handlers line at the beggining of the file.

      Steps to reproduce

      1. Start first tomcat node and wait until startup finish
      2. Verify you can login from browser using URL: http://localhost:8080/web/guest
      3. Start second tomcat node and wait until startup finish
      4. Review LIFERAY_HOME/tomcat-8.0.32/logs/cluster.2017-xx-xx.log files of both nodes (configured in previous steps) and verify that tomcat cluster is working.
      5. Login and logout in both tomcat cluster nodes using following URLs: http://localhost:8080/web/guest and http://localhost:8180/web/guest
      6. Check again cluster log files of both:
        • Correct behavior: No error is displayed
        • Wrong behavior: Following error is displayed in some session event replication, in the opposite node
          (if you login in first node, error is displayed in second one and vice-versa)
          09-May-2017 08:10:56.974 SEVERE [Tribes-Task-Receiver-3] org.apache.catalina.ha.session.DeltaManager.messageReceived Manager [localhost#]: Unable to receive message through TCP channel
           java.lang.ClassNotFoundException: org.eclipse.equinox.http.servlet.internal.servlet.HttpSessionAdaptor$ParentSessionListener
          	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
          	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
          	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          	at java.lang.Class.forName0(Native Method)
          	at java.lang.Class.forName(Class.java:348)
          	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:628)
          	at org.apache.catalina.tribes.io.ReplicationStream.resolveClass(ReplicationStream.java:80)
          	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
          	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
          	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)
          	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
          	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
          	at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(DeltaRequest.java:387)
          	at org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.java:277)
          	at org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(DeltaManager.java:565)
          	at org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1233)
          	at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1177)
          	at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:916)
          	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:769)
          	at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:296)
          	at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:81)
          	at org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor.messageReceived(TcpPingInterceptor.java:172)
          	at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:81)
          	at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:117)
          	at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:81)
          	at org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor.messageReceived(StaticMembershipInterceptor.java:94)
          	at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:81)
          	at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:262)
          	at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:242)
          	at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:211)
          	at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:102)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	at java.lang.Thread.run(Thread.java:745)
          

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 43 weeks, 4 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP18
                  7.0.3 CE GA4
                  7.0.0 DXP SP4
                  7.0.X EE
                  7.1.X
                  Master