Mantis - Resin
Viewing Issue Advanced Details
4179 minor always 08-16-10 08:47 01-18-11 10:22
ferg  
ferg  
normal  
closed 4.0.9  
duplicate  
none    
none 4.0.12  
0004179: session deserialization to HashMap
(rep by Matthew Serrano)

I am running resin 4.0.7 and I store a user object in the session using "User_Bean" as a key. Everything works fine most of the time but it seems when my session expires and I have not logged out, every subsequent call to get this object returns some HashMap instead of my object or null. Since I am casting the object when I retrieve it from the session the message I get is:

java.lang.ClassCastException: java.util.HashMap cannot be cast to com.ordinate.ppass.beans.UserBean

Is there some reason why getting an object from the session would return a Map instead of the object? Is "User_Bean" some reserved word or something? The only way I have been able to get my application working again is to shutdown the server, delete everything in the resin-data folder and restart (deleting the exploded war, deploying the app again, restarting all do not work).

Also, this seems to happen on resin 4.0.9 as well.

Notes
(0004721)
ferg   
08-16-10 12:11   
I figured out how to replicate my issue:

If I log in to my application, deploy a war file to webapps, and then refresh my page at the same time the app is automatically reloading, I can cause the error. This is fairly difficult to do consistently but given a few tries I can make it happen. I changed my dependency-check internal to 30 seconds (instead of default 2s) and it was more difficult to replicate because I would refresh my page before the server automatically redeployed which would then trigger the redeployment and everything would work properly. It only seems to happen if you magically access the session as resin is reloading but given that I am able to replicate it pretty easily it seems like something that will definitely happen if we use autodeploy.

Is there a recommendation or guideline not to use autodeploy in production? If not, perhaps there is a bug here that needs to be addressed?
(0004953)
ferg   
01-18-11 10:22   
0004254