This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hi I have setup a Tomcat cluster using SimpleTcpCluster feature provided by tomcat. While doing this I see that replication is throwing error for some of my classes for not being serializable even if they are not part of the HttpSession, though they are added to the ServletContext. Hence I wanted to know if ServletContext is also replicated in Session replication across Tomcats?
All references in a Session MUST be serializable if the session is to be stored or replicated. ServletContext can NOT be serializable since it is heavily involved with the details of a given servlet engine.
I bet that if you dig into the stack trace from the exception you will find some useful information to isolate where the problem originates.
Joined: Jan 01, 2007
Yes. I figured it out. I have a session attribute which is extended by a couple of classes and these classes had some non-serializable members.