Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-2865

Session Replication for CDI beans fails often

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 8.0.2, 8.0.3, 8.0.5, 8.0.6
    • None
    • TomEE Core Server
    • None

    Description

      Session clustering / replication often fails with this exception:

      java.lang.IllegalStateException: On a thread without an initialized context nor a classloader mapping a deployed app
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:350)
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(ThreadSingletonServiceImpl.java:326)
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:361)
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:69)
      at org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(WebBeansFinder.java:57)
      at org.apache.webbeans.config.WebBeansContext.getInstance(WebBeansContext.java:180)
      at org.apache.webbeans.config.WebBeansContext.currentInstance(WebBeansContext.java:198)
      at org.apache.webbeans.context.PassivatingContext.readExternal(PassivatingContext.java:50)
      at java.base/java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:2191)
      at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2140)
      at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646)
      at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:464)
      at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
      at org.apache.catalina.ha.session.DeltaSession.doReadObject(DeltaSession.java:849)
      at org.apache.catalina.ha.session.DeltaSession.readObjectData(DeltaSession.java:631)
      at org.apache.catalina.ha.session.DeltaSession.readExternal(DeltaSession.java:606)
      at java.base/java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:2191)
      at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2140)
      at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646)
      at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:464)
      at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
      at org.apache.catalina.tribes.io.XByteBuffer.deserialize(XByteBuffer.java:560)
      at org.apache.catalina.tribes.tipis.AbstractReplicatedMap$MapMessage.value(AbstractReplicatedMap.java:1507)
      at org.apache.catalina.tribes.tipis.AbstractReplicatedMap$MapMessage.deserialize(AbstractReplicatedMap.java:1465)
      at org.apache.catalina.tribes.tipis.AbstractReplicatedMap.messageReceived(AbstractReplicatedMap.java:663)
      at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:336)
      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.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:213)
      at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:101)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:834)

      Setup:
      Nginx, TomEE N1, TomEE N2

      Steps to reproduce:

      • Open the browser and call the webapp
      • Session will be initialized on N1
      • Shutdown N1
      • Open the link again and you will see your initialized session on N2
      • Startup N1
      • Open the link again -> exception will be thrown

      Will post the configs in the comments

      Attachments

        Activity

          People

            jungm Markus Jung
            tandraschko Thomas Andraschko
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: