My Personal Online Recycle Bin
You may find something useful here...........

Tuesday, May 02, 2006

NotSerializableException, Session Replication with jboss

Last friday, Jboss thrown NotSerializableException to me after i add in session replication in jboss.

I quickly knew that some of the class that is add into session is not implementing serializable.

Serializable allow object state to be saved and retrieved to another external source. Since anything add to session in one jboss need to also add to another jboss for session replication purpose, thus any class that may need to stored in session must implement serializable interface.

Serializable is just a marker interface, no method need to be inherited or override in order to make it work. Anyway, it was always a good pratice to include "serialVersionUID" if serializable is implemented.

So, today i have learn
any class that may need to stored in session should always implement serializable interface

1 Comments:

Post a Comment

<< Home