When trying to store a List variable of custom objects
session.setAttribute
is complaining that’s the variable is not serializable.
Your entire servlet session can be serialized to disk or another store at any moment. So all objects in it must be serializable.