aspose file tools*
The moose likes Tomcat and the fly likes Is ServletContext replicated in Session replication? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Is ServletContext replicated in Session replication?" Watch "Is ServletContext replicated in Session replication?" New topic
Author

Is ServletContext replicated in Session replication?

Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
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?

TIA
Satya Deep


Thanks and Regards
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
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.

Bill
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
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.

Thanks
Satya Deep
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is ServletContext replicated in Session replication?