• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing an Object in the Session should be serializable??

 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple web-app that stores an object in the session using session.setAttribute() method.

I get this warning below

<Web application: ServletContext(id=1307463,name=prepaidactivate,context-path=/prepaidactivate) tried to place a non-serializable attribute: allData into the session: "sessionIDblahblahblah"
This attribute will be lost upon redeployment. This message is logged only once per session

Can anyone tell me should I make the object serializable? and why I should?

Cheers
Reggie
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So that the container, should it choose to do so, can serialize the session to disk to save memory.
 
Vijay Vaddem
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For more information...

Go through the below given link.

http://e-docs.bea.com/wls/docs81/messages/HTTPSession.html

You can see the explanation for your error message between
BEA-100061 and BEA-100064
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!