You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Adriano dos Santos Fernandes <ad...@uol.com.br> on 2009/03/23 14:48:31 UTC

Session lost when app. is redeployed

Hi!

First, I must say that I found in the archives the exact problem I have 
now, but no solution was presented.

My application (built using Apache Wicket), is stateful. When I reload 
it, or when I restart Tomcat, the session is correctly serialized and 
restored. Jetty is also able to restore sessions. So it's not a problem 
of non serializable classes stored in the session.

The problem is when I redeploy the application, no mater how I do it 
(replacing war, with lambda probe or with tomcat redeployer). Even if 
the war was not changed, the session is destroyed.

We need to change and redeploy the application during production hours. 
We can't do that breaking all users sessions. Is there a way to do that?


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Subject: RE: Session lost when app. is redeployed
> 
> from what I've seen the normal way of handling the webapp reload 
> is to clean off the work folder *.ser files

Don't confuse reload with undeploy; Tomcat creates the SESSIONS.ser file when a webapp is stopped, and leaves it there unless an undeploy is done.  It certainly does not delete the file on a simple webapp reload.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session lost when app. is redeployed

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
Martin Gainty wrote:
> Adriano-
>
> from what I've seen the normal way of handling the webapp reload is to clean off 
> the work folder *.ser files 
> this would be considered 'normal behaviour' since your webapp configuration has changed the attributes for any previous serialised objects would be changed as well..
> thus any serialised objects should NOT be deserialised back into the webapp
>
> does this not make sense ?
I don't think so... If I'm fixing bugs that does not affect session 
data, what's the problem to maintain it? I still don't see an easy way 
to do that.

If my session classes changes (depending on the changes), it could not 
be deserialized anyway.


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by Martin Gainty <mg...@hotmail.com>.
Adriano-

from what I've seen the normal way of handling the webapp reload is to clean off 
the work folder *.ser files 
this would be considered 'normal behaviour' since your webapp configuration has changed the attributes for any previous serialised objects would be changed as well..
thus any serialised objects should NOT be deserialised back into the webapp

does this not make sense ?
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
This message is confidential and may be privileged. If you are not the intended recipient, we kindly ask you to  please inform the sender. Any unauthorised dissemination or copying hereof is prohibited. This message serves for information purposes only and shall not have any legally binding effect. Given that e-mails can easily be subject to manipulation, we can not accept any liability for the content provided.






> Date: Wed, 25 Mar 2009 20:11:33 +0100
> Subject: Re: Session lost when app. is redeployed
> From: joseph.millet@gmail.com
> To: users@tomcat.apache.org
> 
> Not sure this might be of use but Apache normally has a *graceful *restart
> option that's normally tailored to such needs.
> 
> On Wed, Mar 25, 2009 at 1:17 PM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Adriano,
> >
> > On 3/24/2009 7:13 AM, Adriano dos Santos Fernandes wrote:
> > > So my question is how to update an application, when it have full
> > > serializable sessions, and the new application classes are compatible
> > > with the serialized session?
> > >
> > > I didn't see any way to do it with Tomcat...
> >
> > I use 5.5.27 and, in development where autoreload=true, I trigger
> > auto-redeployments all the time by changing web.xml, adding libraries,
> > or updating classes. My sessions remain in-tact without a problem
> > (unless, of course, I change a class for an object that is actually in a
> > live session).
> >
> > No logs at all, eh?
> >
> > What about the serialized sessions file? Under the circumstances when
> > the sessions /are/ persisted, can you locate the serialized sessions
> > file (while the app is stopped, that is)? Copy it to a temporary location.
> >
> > What about in the case where the sessions file is /not/ persisted
> > (again, while the app is stopped and/or undeployed). Is the file still
> > there? If not, what happens if you take the file from above and use it
> > as a surrogate, placing it in the right place at the right time?
> >
> > I'm wondering if the problem is in saving the sessions or loading them.
> > I suspect that Tomcat is not saving them when you undeploy. I'm not sure
> > why, since Tomcat claims to do it:
> >
> > http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html#Restart%20Persistence
> >
> > If you put <distributable> in your web.xml, do you get any errors?
> >
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (MingW32)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> >
> > iEYEARECAAYFAknKIMoACgkQ9CaO5/Lv0PC0fQCgjGDckxzlxMrrA6RY7Yovaxpw
> > sZAAoKN9qtucZn7/NlAMRJg6GJt1Be+g
> > =Lcp/
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >

_________________________________________________________________
Express your personality in color! Preview and select themes for HotmailĀ®.
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme

Re: Session lost when app. is redeployed

Posted by Joseph Millet <jo...@gmail.com>.
Not sure this might be of use but Apache normally has a *graceful *restart
option that's normally tailored to such needs.

On Wed, Mar 25, 2009 at 1:17 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Adriano,
>
> On 3/24/2009 7:13 AM, Adriano dos Santos Fernandes wrote:
> > So my question is how to update an application, when it have full
> > serializable sessions, and the new application classes are compatible
> > with the serialized session?
> >
> > I didn't see any way to do it with Tomcat...
>
> I use 5.5.27 and, in development where autoreload=true, I trigger
> auto-redeployments all the time by changing web.xml, adding libraries,
> or updating classes. My sessions remain in-tact without a problem
> (unless, of course, I change a class for an object that is actually in a
> live session).
>
> No logs at all, eh?
>
> What about the serialized sessions file? Under the circumstances when
> the sessions /are/ persisted, can you locate the serialized sessions
> file (while the app is stopped, that is)? Copy it to a temporary location.
>
> What about in the case where the sessions file is /not/ persisted
> (again, while the app is stopped and/or undeployed). Is the file still
> there? If not, what happens if you take the file from above and use it
> as a surrogate, placing it in the right place at the right time?
>
> I'm wondering if the problem is in saving the sessions or loading them.
> I suspect that Tomcat is not saving them when you undeploy. I'm not sure
> why, since Tomcat claims to do it:
>
> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html#Restart%20Persistence
>
> If you put <distributable> in your web.xml, do you get any errors?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAknKIMoACgkQ9CaO5/Lv0PC0fQCgjGDckxzlxMrrA6RY7Yovaxpw
> sZAAoKN9qtucZn7/NlAMRJg6GJt1Be+g
> =Lcp/
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Session lost when app. is redeployed

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adriano,

On 3/24/2009 7:13 AM, Adriano dos Santos Fernandes wrote:
> So my question is how to update an application, when it have full
> serializable sessions, and the new application classes are compatible
> with the serialized session?
> 
> I didn't see any way to do it with Tomcat...

I use 5.5.27 and, in development where autoreload=true, I trigger
auto-redeployments all the time by changing web.xml, adding libraries,
or updating classes. My sessions remain in-tact without a problem
(unless, of course, I change a class for an object that is actually in a
live session).

No logs at all, eh?

What about the serialized sessions file? Under the circumstances when
the sessions /are/ persisted, can you locate the serialized sessions
file (while the app is stopped, that is)? Copy it to a temporary location.

What about in the case where the sessions file is /not/ persisted
(again, while the app is stopped and/or undeployed). Is the file still
there? If not, what happens if you take the file from above and use it
as a surrogate, placing it in the right place at the right time?

I'm wondering if the problem is in saving the sessions or loading them.
I suspect that Tomcat is not saving them when you undeploy. I'm not sure
why, since Tomcat claims to do it:
http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html#Restart%20Persistence

If you put <distributable> in your web.xml, do you get any errors?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknKIMoACgkQ9CaO5/Lv0PC0fQCgjGDckxzlxMrrA6RY7Yovaxpw
sZAAoKN9qtucZn7/NlAMRJg6GJt1Be+g
=Lcp/
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br]
> Subject: Re: Session lost when app. is redeployed
> 
> are you *reloading* the application, or in some way or another,
> updating (redeploying) it?

Yes; as I stated, I followed the exact same procedure you documented, including the touch of WEB-INF/web.xml.  The logs show the webapp being removed from memory and reloaded.

> As I said, I can reload it preserving the session, but that is not
> something that I'm looking for.

??? A reload does load all the classes from the deployment directory (which is why it's called "reload").  If you've changed them you get the new copies.  If you do an undeploy (you shouldn't), you will lose your sessions.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session lost when app. is redeployed

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
Caldarale, Charles R escreveu:
>> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br]
>> Subject: Re: Session lost when app. is redeployed
>>
>> I mainly used Lambda Probe. I now also tried:
>> - stop the application
>> - touch the war
>> - start the application
>> - application is undeployed and deployed, and session is lost
>>     
>
> I still cannot duplicate your problem.  Unless I explicitly undeploy the webapp, the session is preserved.  When I followed the exact sequence given above - using both manager and LambdaProbe - no undeployment occurred, just an application reload, and the session data was properly recovered and remained intact.
Charles, are you *reloading* the application, or in some way or another, 
updating (redeploying) it?

As I said, I can reload it preserving the session, but that is not 
something that I'm looking for. I want to update the application and 
preserve the sessions.


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br]
> Subject: Re: Session lost when app. is redeployed
> 
> Then I touch (with gnuwin32 touch utility) the war file.

I've finally been able to reproduce your observations, but only by touching the .war file itself.  Anything else, including touching WEB-INF/web.xml, leaves the sessions intact.  This certainly does seem to be an inconsistency, and probably warrants a bug report.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session lost when app. is redeployed

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
Caldarale, Charles R escreveu:
>> From: Caldarale, Charles R
>> Subject: RE: Session lost when app. is redeployed
>>
>> I've finally been able to reproduce your observations, but only by
>> touching the .war file itself.
>>     
>
> There is a workaround to this problem.  Create a META-INF/context.xml file in your webapp, with the following content:
> <Context>
>   <Manager pathname="${catalina.base}/sessions/example.ser"/>
> </Context>
>
> (plus whatever else you already have in any existing <Context> element, of course).
>
> This will tell the session manager to store the serialized session data for this webapp in sessions/example.ser; you can set the path to whatever you want, but all directories in the path must exist prior to redeploying the webapp.  By keeping the session data outside of the webapp's work area, the redeployment process will not delete it.
Unfortunately, that shows another problem with my real application. When 
I touch the war. The session is deserialized before full war is 
unpacked. Stack trace is below, and my WEB-INF has only lib (no 
classes), and WEB-INF/lib has only some jars, not all. If I set 
unpackWARs to false, it apparently works ok.

=================
27/03/2009 09:03:14 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/Sistema]
27/03/2009 09:03:16 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive Sistema.war
27/03/2009 09:03:17 org.apache.catalina.session.StandardManager start
SEVERE: Exception loading sessions from persistent storage
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at org.apache.wicket.Application.<clinit>(Application.java:143)
    at 
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.getPageStore(SecondLevelCacheSessionStore.java:205)
    at 
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:408)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at 
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at 
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1441)
    at 
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:942)
    at 
org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:394)
    at 
org.apache.catalina.session.StandardManager.load(StandardManager.java:321)
    at 
org.apache.catalina.session.StandardManager.start(StandardManager.java:637)
    at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
    at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
    at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
    at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
    at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
    at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at 
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
    at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ... 32 more
=================


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Caldarale, Charles R
> Subject: RE: Session lost when app. is redeployed
> 
> I've finally been able to reproduce your observations, but only by
> touching the .war file itself.

There is a workaround to this problem.  Create a META-INF/context.xml file in your webapp, with the following content:
<Context>
  <Manager pathname="${catalina.base}/sessions/example.ser"/>
</Context>

(plus whatever else you already have in any existing <Context> element, of course).

This will tell the session manager to store the serialized session data for this webapp in sessions/example.ser; you can set the path to whatever you want, but all directories in the path must exist prior to redeploying the webapp.  By keeping the session data outside of the webapp's work area, the redeployment process will not delete it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session lost when app. is redeployed

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
Caldarale, Charles R escreveu:
> That is the trace of the SESSIONS.ser file being written, which is created *before* any ServletContextListener is called via contextDestroyed().  If any such listener removes everything in the work directory, the sessions will be lost.
I tried now a very basic example, based on Maven quickstart. web.xml is 
almost empty, and a jsp page:
=================
<html>
<body>

<%
    String x = (String) request.getSession(true).getAttribute("x");
    if (x == null)
        x = "0";
    int y = Integer.valueOf(x) + 1;
    request.getSession(true).setAttribute("x", String.valueOf(y));
%>

<%= y %>

</body>
</html>
=================

So I start reloading the page. The number increments. I can stop/start 
or reload the app. The number continue incrementing.

Then I touch (with gnuwin32 touch utility) the war file. The Tomcat 
console displays:
=================
26/03/2009 11:11:28 org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
26/03/2009 11:12:02 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/example]
26/03/2009 11:12:02 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive example.war
=================

You see, it undeployed, and the counter has reseted.

Now, I tried delete webapps/example. After some seconds, the war is 
exploded and same thing as above happens.

Then I tried to delete webapps/example/*, leaving the directory empty. 
This way, I can manually extract the war there, and session is preserved.

Is it correct? Why it can't be simple, as update the war and reload 
(without undeploy) happen?

Thanks,


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br]
> Subject: Re: Session lost when app. is redeployed
> 
> When redeployed, this directory is cleared.

I suspect your webapp is also clearing the work directory as it shuts down, which deletes the SESSIONS.ser file.

> During the redeploy, I don't see creation of any .ser file.

Your log shows otherwise:
> 26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
> FINE: writeObject() storing session 7BA0CDCC214AA9C4DA3A534F0575262F
> 26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
> FINE:   storing attribute 'Wicket:SessionUnbindingListener-WicketFilter' 
> with value 
> 'org.apache.wicket.protocol.http.AbstractHttpSessionStore$SessionBindingListener@14f02fb'
> 26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
> FINE:   storing attribute '__lambda_probe_la_ip' with value '127.0.0.1'
> 26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
> FINE:   storing attribute 'wicket:WicketFilter:m:null' with value 
> '[PageMap name=null]'
> 26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
> FINE:   storing attribute 'wicket:WicketFilter:session' with value 
> 'mm.sistema.web.WebSession@6e8697'

That is the trace of the SESSIONS.ser file being written, which is created *before* any ServletContextListener is called via contextDestroyed().  If any such listener removes everything in the work directory, the sessions will be lost.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session lost when app. is redeployed

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
Caldarale, Charles R escreveu:
> Try updating your logging.properties to set the logging level for your webapp to FINE, restart Tomcat, and then do your procedure again.  Use something like this:
>
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/<appName>].level = FINE
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/<appName>].handlers = 2localhost.org.apache.juli.FileHandler
Doing that and redeploying with LambdaProbe, I see in the log:
26/03/2009 08:37:14 org.apache.catalina.core.StandardContext filterStop
FINE: Stopping filters
26/03/2009 08:37:14 org.apache.catalina.core.StandardContext filterStop
FINE:  Stopping filter 'WicketFilter'
26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
FINE: writeObject() storing session 7BA0CDCC214AA9C4DA3A534F0575262F
26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
FINE:   storing attribute 'Wicket:SessionUnbindingListener-WicketFilter' 
with value 
'org.apache.wicket.protocol.http.AbstractHttpSessionStore$SessionBindingListener@14f02fb'
26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
FINE:   storing attribute '__lambda_probe_la_ip' with value '127.0.0.1'
26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
FINE:   storing attribute 'wicket:WicketFilter:m:null' with value 
'[PageMap name=null]'
26/03/2009 08:37:14 org.apache.catalina.session.StandardSession writeObject
FINE:   storing attribute 'wicket:WicketFilter:session' with value 
'mm.sistema.web.WebSession@6e8697'
26/03/2009 08:37:27 org.apache.catalina.core.StandardContext listenerStart
FINE: Sending application start events
26/03/2009 08:37:27 org.apache.catalina.core.StandardContext filterStart
FINE: Starting filters
26/03/2009 08:37:27 org.apache.catalina.core.StandardContext filterStart
FINE:  Starting filter 'WicketFilter'


Wicket store files in Catalina/localhost/AppName/WicketFilter-filestore. 
When redeployed, this directory is cleared. So I've changed a setting to 
put these files in another place.

But still, after deploying, when I try to work on the application again, 
my JSESSIONID cookie written in the log is changed. During the redeploy, 
I don't see creation of any .ser file.


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br]
> Subject: Re: Session lost when app. is redeployed
> 
> I mainly used Lambda Probe. I now also tried:
> - stop the application
> - touch the war
> - start the application
> - application is undeployed and deployed, and session is lost

I still cannot duplicate your problem.  Unless I explicitly undeploy the webapp, the session is preserved.  When I followed the exact sequence given above - using both manager and LambdaProbe - no undeployment occurred, just an application reload, and the session data was properly recovered and remained intact.

Try updating your logging.properties to set the logging level for your webapp to FINE, restart Tomcat, and then do your procedure again.  Use something like this:

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/<appName>].level = FINE
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/<appName>].handlers = 2localhost.org.apache.juli.FileHandler

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session lost when app. is redeployed

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
Caldarale, Charles R escreveu:
>> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br] 
>> Subject: Re: Session lost when app. is redeployed
>>
>> What cause session lost is redeploy. 
>>     
>
> There is no "redeploy" in the Tomcat manager.  What is the exact procedure you're doing?
I mainly used Lambda Probe. I now also tried:
- stop the application
- start the application
- session is preserved

- stop the application
- touch the war
- start the application
- application is undeployed and deployed, and session is lost

So my question is how to update an application, when it have full 
serializable sessions, and the new application classes are compatible 
with the serialized session?

I didn't see any way to do it with Tomcat...


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br] 
> Subject: Re: Session lost when app. is redeployed
> 
> What cause session lost is redeploy. 

There is no "redeploy" in the Tomcat manager.  What is the exact procedure you're doing?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Session lost when app. is redeployed

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
Caldarale, Charles R escreveu:
>> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br] 
>> Subject: Session lost when app. is redeployed
>>     
>
> Don't you think that telling us the version of Tomcat you're using, the JRE/JDK level, platform, etc., just might be useful information?
>   
Tomcat 6.0.18, Sun JDK 1.6.0_07, Windows, sorry.

>   
>> The problem is when I redeploy the application, no mater 
>> how I do it (replacing war, with lambda probe or with 
>> tomcat redeployer). Even if the war was not changed, the
>> session is destroyed.
>>     
>
> I can't reproduce your problem on the current level (6.0.18); all sessions and their attributes remain intact after reloading a webapp via the Tomcat manager.  Note that if a webapp is *stopped*, the sessions are removed from memory, but they are persisted to the work directory first, and recovered when the application is restarted.
Reload works ok for me. What cause session lost is redeploy. It appears 
for me that any type of redeploy does undeploy->deploy, and undeploy 
does not serialize the session.


Adriano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Session lost when app. is redeployed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Adriano dos Santos Fernandes [mailto:adrianosf@uol.com.br] 
> Subject: Session lost when app. is redeployed

Don't you think that telling us the version of Tomcat you're using, the JRE/JDK level, platform, etc., just might be useful information?

> The problem is when I redeploy the application, no mater 
> how I do it (replacing war, with lambda probe or with 
> tomcat redeployer). Even if the war was not changed, the
> session is destroyed.

I can't reproduce your problem on the current level (6.0.18); all sessions and their attributes remain intact after reloading a webapp via the Tomcat manager.  Note that if a webapp is *stopped*, the sessions are removed from memory, but they are persisted to the work directory first, and recovered when the application is restarted.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org