users@glassfish.java.net

Re: Custom Login Realm Serializable Exception

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Mon, 16 Nov 2009 08:55:47 -0800

On 11/16/09 07:34, Hassan Schroeder wrote:
> On Sun, Nov 15, 2009 at 3:54 AM, Lasitha Kodikara
> <lasithabk_at_millenniumit.com> wrote
>
>> However even I get this, when I stop and starts the server still the user authentication is remembered (J).
>>
>> Can you please help me to get rid of this exception.
>>
>> java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: sun.security.acl.PrincipalImpl
>>
>
> What is unclear about this? You're storing a non-serializable object
> in the session. Sessions are preserved across restarts by being saved
> to the file system, but your authenticated session can't be.
>

Thanks, Hassan, you're absolutely right!

And of course, this behaviour may be turned off as described here:

  http://blogs.sun.com/jluehe/entry/how_to_disable_persisting_of
<http://blogs.sun.com/jluehe/entry/how_to_disable_persisting_of>
  ("How to Disable Persisting of Memory-based HTTP Sessions during a
  Server Restart")

Jan

> HTH,
> --
> Hassan Schroeder ------------------------ hassan.schroeder_at_gmail.com
> twitter: @hassan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>