Hi
Is it possible to find from log files or some where, what is preventing from
tomcat not able to persist sessions, all the classes saved in tomcat
are serialized, they implement implements Serializable.
where does tomcat save this serialized data file on PC, i want to see if
this is created
I have switched from tomcat plugin and using tomcat directly and still have
this error, i created a JSP which simply dumps all the objects in session on
webpage, before saving any class i have 2 objects in session, as soon as i
save the class and tomcat restarts and i refresh this jsp page, there are no
objects in session class.

Ashish

On Tue, Feb 16, 2010 at 4:44 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----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
>
>


-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com

Reply via email to