Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is ServletContext replicated in Session replication?

 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic