You should not try to Serialize
your SessionLoader
class as it has HttpSession
object, Just make your SessionLoader
transient
.
private transient SessionLoader loader = new SessionLoader();
But you can still serialize
the contents of your session attributes
, for that you need to first iterate through your session attributes
and serialize individually.