tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Endre StĂžlsvik <>
Subject Re: ClassCastException
Date Sat, 25 Nov 2000 13:35:54 GMT
On Sat, 25 Nov 2000, Kurt Bernhard Pruenner wrote:

| I guess a solution would be to invalidate the session when such a
| ClassCastException occurs, but of course the exception is likely to happen in
| your own code and not at a point where Tomcat can do this for you; maybe an
| option per context for "invalidating all sessions on reload" (which shouldn't
| be too tragic in a development environment, which servlet reloading is really
| meant for) would be helpful...

An option that, on noticing that a class had changed, just invalidated all
the sessions so that my session-objects could store themself to dB, then
discarded ALL classes (so that they would reload) would be so _extremely_

My session handling basically revolves around one "large" UserSession
object. I often end up with ClassCastException when I'm trying to cast the
Object I'm getting out of the HttpSession to UserSession. Is this the
problem you described here? What I do is to just make a new UserSession,
but then I end up with a bunch of usersessions after a while..

I get ClassCastException, but I'm also having some problems with
reloading. I'm dynamically loading (forName(..).newInstance()) a set of
classes, what happens with these?

My servlets all extend a "super-servlet". It seems to me that when I
recompile, just the first servlet (extending this super servlet) I hit
actually gets reloaded, the other ones doesn't. Is this true in any way,
or am I totally off here?


View raw message