wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Unable to deserialize MapMessage error while session replication for ArrayList applicationattributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Unable to deserialize MapMessage error while session replication for ArrayList applicationattributes" Watch "Unable to deserialize MapMessage error while session replication for ArrayList applicationattributes" New topic
Author

Unable to deserialize MapMessage error while session replication for ArrayList applicationattributes

Paul Jacob
Greenhorn

Joined: Jul 25, 2009
Posts: 15
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

Joined: Feb 29, 2012
Posts: 1
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

Joined: Oct 27, 2005
Posts: 19653
    
  18

Thanks for sharing


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: Unable to deserialize MapMessage error while session replication for ArrayList applicationattributes
 
Similar Threads
How to use Reflection API in this scenario?
Serialization doubt
Need Article Links On "Active and Passive Replication"
Application has all memory params set, Still Consumed Memory is way too high
websphere 7 clustering environment with Session Replication queries.