• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is ServletContext replicated in Session replication?

 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic