SEVERE: IOException while loading persisted sessions:
java.io.WriteAbortedException:
writing aborted; java.io.NotSerializableException:
That means this object cannot be persisted on hard disk.
Does it imply that it's not safe to keep in Session objects that do not implement "Serializable"?
I haven't heard that there are limitations on saving non-serializable objects in Session object.
It simply means that Tomcat will always keep them in memory, right?
Does it imply that it's not safe to keep in Session objects that do not implement "Serializable"?
That's exactly right, yes.
However, many servlet containers will let you get away with it, if they don't actually need to do any serialization.
For example, Tomcat doesn't care if the session attributes are serializable or not, unless you enable session replication. It needs to be able to serialize the attributes to replicate them to the other servers in the cluster.
In your case, it seems that the container is trying to persist the session data to disk, which again would require serialization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With