tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francisco J. León" <>
Subject Tomcat "forgets" a session attribute when reloading context
Date Thu, 21 Apr 2005 14:50:43 GMT
Hi 'catters. I am having a small but annoying behavior in Tomcat. 
Tested on
5.0.28 and 5.5.9. I posted this as bug 34547 but a developer thinks 
it's not a bug.

I use Eclipse 3.02 for development, along the Sysdeo Tomcat Plugin and
Freemarker for MVC. My context path is set to be reloadable, and when i 
coding, if i make some change to the code, the context gets reloaded by 
plugin, and a session attribute gets null'ed.

The weirdest thing is that not all of the session attributes are 
nulled. Just
this one we will call "user".

I will try to explain what happens with pseudocode.

When the users log on to my application, this happens:

ForumUser user = run_sql_here;

ForumUser is a bean with some properties. That query stores:
-a user id (int)
-a timezone (string)
-a language (string)

All of the other attributes in the object are not used at this time.


if (user!=null) {

This is the ONLY time that attribute gets set. It ONLY gets removed 
when the
session is invalidated.

When i change code and the context gets reloaded, the "user" attribute 
null, and the other 2 attributes (permission and logged_user_name) are 

If i don't reload the context, everything is OK.

Does anyone have any idea of what is going on?

Do you guys need my code? I will gladly do whatever test you need me to
do to resolve this. It is very annoying to keep logging out and back in 
to test
new code so my session gets corrected

Why this doesn't look like a bug? Tomcat deletes an object in my 
session. If it would delete all objects,
then i wouldn't have posted this, since i would have thought that 
reloading a context would delete the whole session.

I think my code is ok since i just set that attribute (the one that 
gets null) at login.

Francisco Javier León Arosemena
X Semestre de Lic. en Computación
Maracaibo, Edo. Zulia, Venezuela

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message