Skip to main content

[webtier] Re: How to turn off session attribute serialization?

1 reply [Last post]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

On 10/ 1/08 04:40 AM, wrote:
> Thanks for the information guys. I'm definitely not restarting the server between deployments or using the 'keepSession' property. I'm using the built-in 'directory deployment' functionality of NetBeans which updates only the files that have changed and then invokes the browser passing a specified url to run the application. This seems to be a very fast way to develop and test so I'm not complaining from that standpoint, its just that it would be nice to not see the Exceptions rolling past on the monitor every time I redeploy. I've tested both closing the browser and leaving the browser open between re-deployments and I get the session persistence Exceptions either way. Here's one example:
> PWC2785: Cannot serialize session attribute majorClassSelection for session 826e5da17c66f0d14eff63ae7b16
> org.json.JSONObject
> where I've placed an object into a session attribute named 'majorClassSelection'. I get this Exception (and several more) every time I redeploy.

I've taken a closer look at this. During a redeploy, a webapp is first
stopped before it is destroyed. As part of being stopped, any active
sessions are serialized and saved to a file, which is then deleted as
part of the subsequent destroy operation. If a stop is followed by a
destroy, it
does not make any sense to save any sessions, and I am going to file
an enhancement request to have the saving of any active sessions suppressed
in this case. This won't be addressed in GlassFish v2.1, though, only
in GlassFish v3.

For the time being, what you can do is bundle the following
sun-web.xml with your webapp, which sets "sessionFilename"
to the empty string:

This will suppress serialization and saving of any active sessions
when your webapp is stopped (as part of a redeploy or server restart).

Let me know if this works for you.



> [Message sent by forum member 'sl5337' (sl5337)]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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