Hi 'catters. I am having a small but annoying behavior in Tomcat. Tested on 5.0.28 and 5.5.9 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 am coding, if i make some change to the code, the context gets reloaded by the 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. session.setAttribute("logged_user_name",username); session.setAttribute("permission",permissions); if (user!=null) { session.setAttribute("userpreferences",user); } 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 gets null, and the other 2 attributes (permission and logged_user_name) are OK 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
Oh sorry i should have mentioned that i use java 1.4.2_07 on linux (arch linux), kernel 2.6.11 with glibc 2.3.4 with NTPL
Please post on tomcat-user instead, as this does not look like a bug.
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.
Custom objects which do not implement java.io.Serializable cannot be persisted across restarts. There should be a message in the logs stating so. Use tomcat-user for more details. Bugzilla is not a support forum/help desk.
Yes, i asked in the list and indeed that was the problem. I of course know bugzilla isn't a help desk, i only posted this because i thought it was a bug, since my other objects in the session were plain strings and weren't experiencing this behavior. That probably means strings implement Serializable or something and i wasn't aware of that. Thanks for the help! :)