• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 5.5.12 HttpSession setAttribute must be serializable

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic