Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to deserialize MapMessage error while session replication for ArrayList applicationattributes

 
Paul Jacob
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am load balancing between two Tomcat 6.0.20 instances with in-memory session replication using DeltaManager & StaticMember. I have a couple of application attributes which are of type ArrayList. The elements within this List is a Serializable type, but still I am getting a :

SEVERE: Unable to deserialize MapMessage.
java.lang.ClassNotFoundException: com.mypackage.myclass
The class is definitely found because both instances are pointing to the same WebContent directory in the Context.xml
Also, sometimes Iget :
SEVERE: Unable to send AbstractReplicatedMap.ping message
org.apache.catalina.tribes.ChannelException: Operation has timed out(3000 ms.).; Faulty members:tcp://12.13.14.15

What could the problem be??
 
Jf Heintz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

sorry for the late answer, but if it can help someone else.
I have exactly the same issue and found no answer on the internet, I just resolved it, so I give you the answer:

It is a matter of classloader, the class must be serializable and loaded in the classpath of the server not in the war.
You can do this by adding a CATALINA_BASE/bin/setenv.sh file

#!/bin/sh
#echo "PREVIOUS CLASSPATH: $CLASSPATH"
export CLASSPATH=/home/tomcat/myapp/classes

and put your data class to share in this folder: /home/tomcat/myapp/classes


Regards,

JF HEINTZ
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic