wood burning stoves 2.0*
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: 39548
    
  27
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 - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 5.5.12 HttpSession setAttribute must be serializable
 
Similar Threads
Not Serializable Exception on server startup
custom security and HttpSession access
NULL Pointer Exception from the class which extends Hash Map. urgent help please
HttpSession Object Persist Across Restart
NULL Pointer Exception from the class while accessing from EJB/ HttpSession