users@glassfish.java.net

Re: why won't this webapp deploy?

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Wed, 17 Feb 2010 14:43:38 -0800

On 02/17/10 01:21 PM, glassfish_at_javadesktop.org wrote:
> If you are in the same situation, here is a workaround, so you can keep "file" session persistence and redeploy without loosing sessions:
>
> 1) deploy your app as usual (with persistence set to "file", e.g. <session-manager persistence-type="file">)
> 2) let sessions to be created
> 3) restart server so that the sessions are preserved in files (don't forget to specify your directory in Configuration->Web Container->Manager Properties->Session File Name)
> 4) go ahead and "redeploy" and let the server spit out the error I mentioned; your app will be removed, but the sessions will stay in the files (if you "deploy" instead, you sessions will be destroyed)
> 5) restart the server
> 6) "deploy" your app (you might need "--force" option)
> 7) enjoy your preserved sessions
>

I've been trying to explain this in my previous reply, but let me try again:

- Sessions are automatically persisted to a container-determined file during
a server restart if you are using the default persistence-type ("memory").
In other words, you do not need to specify "file" as your persistence
type if all
you need is for your sessions to survive a server restart: You get this
behaviour for free! (You can disable this default behaviour as described in
http://blogs.sun.com/jluehe/entry/how_to_disable_persisting_of.)

- Session retainment across redeployments also does not require "file"
persistence
type. Instead, if you redeploy using

  asadmin redeploy --properties keepSessions=true

any active sessions will be serialized and cached in memory, and
deserialized
and reactivated when the redeployment has been completed.
See
http://blogs.sun.com/jluehe/entry/retain_session_data_during_redeployment
for details.


If you do end up using "file" persistence type for whatever reason, your
sessions
will be persisted to the specified file during a server restart, but the
specified
file is supposed to be removed during a redeployment, because a
redeployment involves
an undeployment, which is supposed to remove any traces of the
undeployed application.
Are you suggesting that the file stays around during a redeployment?
That would be a bug.

The only reliable way of retaining sessions during redeployments is via the
mechanism described above.

Thanks,

Jan

> [Message sent by forum member 'javjav' (visualitems_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=387255
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>