It is happening because somewhere in your code, you are storing a UserDAO in the session (or you are storing an object that has a reference to a UserDAO). Tomcat tries to serialize the full object graph of all active sessions when you shut it down, and then it tries to restore them when you start it back up. The crux of this is that Tomcat uses "normal" java object serialization, which requires all objects to be Serializable.
How to remedy:
- Don't store non-serializable objects in the users session (generally a good practice).
- Make your UserDAO serializable. Probably involves implementing the
Serializable interface and marking your hibernateTemplate as transient as i don't think that HibernateTemplate is, in itself, serializable. You may have to add some code that re-initialize the hibernateTemplate on deserialization if you really want it to work.
- Don't have Tomcat serializing sessions (add
to the context.xml, either in your own app or in the global tomcat context.xml in the conf/ directory, inside the element. This might be the best course of action for you, unless you really need sessions to be persisted across restarts.