-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ashish,
On 2/16/2010 4:35 PM, Ashish Kulkarni wrote: > I use tomcat 5.5.28 for my development in eclipse, when ever i change any > class it restarts my tomcat and i loose my session, so i have to go through > login process to get the session. > Is it possible to save this session across restarts, it would be great and > save me a lot of time in development The problem isn't that your session isn't being persisted across restarts: it's that your session contents are incompatible after the restart. What happens is this: 1. Your webapp creates an object of a class, say, MyBean v1, and stuffs it into the session. 2. You modify MyBean.java, recompile, and redeploy 3. Tomcat detects the updated class, saves the sessions to the disk, re-deploys your webapp, and re-loads the sessions from the disk 4. During re-loading, the object from MyBean v1 tries to load into an environment where only MyBean v2 is available, and an exception occurs, so the session is not recovered Possible solutions are to (a) set the serialVersionId of your class or (b) write your own serialization methods (see Java serialization howtos for that) The other possibility is that you've got non-serializable objects in the session, which will prevent your session from persisting in the first place. Session is persistence is enabled by default, and should work. It's very possible that your webapp is interfering with the process. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt7EaMACgkQ9CaO5/Lv0PALtQCgkfJuYvzGSFK35H1mpG8du0ph dlMAoIWeRf32GgPOFteRgEQMm6WhzUoi =5ciA -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org