It's not a secret anymore!*
The moose likes Tomcat and the fly likes Tomcat 5.5.12 HttpSession setAttribute must be serializable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 5.5.12 HttpSession setAttribute must be serializable" Watch "Tomcat 5.5.12 HttpSession setAttribute must be serializable" New topic
Author

Tomcat 5.5.12 HttpSession setAttribute must be serializable

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Not a question but an observation (others might find helpful when searching)

When you want to store a value in the attributes of a HttpSession Tomcat requires it to be serializable. Seems it is a result of the cluster support Tomcat offers.
I tried to stuff a HashMap into an attribute and was kicked with an "not serializable" error. Packing the HashMap into a wrapper object with "implements serializable" did the trick.

WAS6 didn't have that problem
:-) stw
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
I think everyone who uses Sessions has run into this at some time or other. What I find interesting is that HashMap does implement Serializable. This sounds like a bug to me.
[ November 22, 2005: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
 
jQuery in Action, 2nd edition
 
subject: Tomcat 5.5.12 HttpSession setAttribute must be serializable