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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to