Question

We have several generated classes, these classes will be regenerated in every startup phase of our web-application. Tomcat has the support for persisting sessions, so when tomcat shutsdown or restarts the classes are persisted.

Our generated classes will be deleted in a shutdown hook. So the next time tomcat starts the web application he complains about the missing class files and fails to restore the sessions.

Is there something we can do against it? Would the javax.annotation.Generated annotation help there? It seems no one really checks for this annotation.

Was it helpful?

Solution

If these classes are not directly stored in the session, then mark their references with transient - they will not be serialized.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top