Environment:
  Apache Tomcat 8.5.11
  OpenJDK Runtime Environment (build 1.8.0_121-b13)

Hi,

I am trying to run a two node Tomcat cluster (server1 & server2) with
an Apache load balancer.
I require both Session and Context replication.

I've had no trouble getting Session replication to work using
SimpleTcpCluster, however I've been unable to get the Context
replication to work.

I have the following config in META-INF/context.xml:
    <Context className="org.apache.catalina.ha.context.ReplicatedContext"/>

and in WEB-INF/web.xml:
    <distributable/>

When I place an object in the server1 ServletContext I see the
following error on server2:

02-Mar-2017 11:31:28.088 SEVERE
[Tribes-Task-Receiver[Catalina-Channel]-3]
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.messageReceived
Unable to deserialize MapMessage.
 java.lang.ClassNotFoundException: com.pharmhos.merlin.jaas.AdUser
        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:677)
        at 
org.apache.catalina.tribes.io.ReplicationStream.resolveClass(ReplicationStream.java:79)
        at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1819)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
        at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1986)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
        at 
org.apache.catalina.tribes.io.XByteBuffer.deserialize(XByteBuffer.java:558)
        at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap$MapMessage.value(AbstractReplicatedMap.java:1504)
        at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap$MapMessage.deserialize(AbstractReplicatedMap.java:1462)
        at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.messageReceived(AbstractReplicatedMap.java:649)
        at 
org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:300)
        at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:83)
        at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:83)
        at 
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:116)
        at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:83)
        at 
org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:276)
        at 
org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:244)
        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.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)

It appears that my AdUser object is being serialized on server1 but is
not being deserialized on server2.

The "AdUser" class exists within the web application under
WEB-INF/classes but it looks like the
org.apache.catalina.tribes.io.ReplicationStream is not using the right
class loader for the web app.

I don't know if this is a configuration error, tomcat bug, or
something else.  Any suggestions on how to diagnose or resolve this
issue will be gratefully received.


Andrew gillett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to