Community
Participate
Working Groups
Build Identifier: 3.0.0.M05 When a web bundle is configured to persist sessions, the mechanism would not be triggered when Virgo restarts. To trigger the mechanism, the web bundle needs to be unloaded first before Virgo is shutdown. When testing this bug, please also note that the path for the session storage has to be an absolute path. Relative paths don't work. This seems to be a Tomcat bug, as it can also be observed on Tomcat 7.0.16. Reproducible: Always Steps to Reproduce: 1. Create a test web bundle, that has a servlet, which would write some values to session and print out the values. 2. Configure META-INF/context.xml to point pathname attribute of Manager element to the absolute path of a file. 3. Start Virgo and load the test web bundle created. 4. Run the test servlet and observe the session values printed. 5. Restart virgo. 6. Rerun the servlet and observe that session values have not been persisted.
Created attachment 198471 [details] Test web bundle. Test web bundle is attached. The test servlet may be accessed at http://localhost:8080/sess/Test. If the bundle is unloaded first before Virgo is shutdown, the session value would be persisted correctly. Otherwise, no session values would be persisted.
Forgot to note that for the test web bundle, the session storage points to /tmp/sess-store.ser. When testing on Windows and that /tmp doesn't exist, first change the pathname in META-INF/context.xml.
I tried hard and I cannot reproduce this on M05 or at HEAD. Some clarifications in case we are doing different things: in step 5 I either use the shutdown.sh script or Ctrl-C to shut down Virgo and then I restart it *not* specifying -clean. After the shutdown, I can see the file /tmp/sess-store.ser as expected. The session SID and value printed out by the web app before and after shutdown are identical. I even ran debugged through org.apache.catalina.session.StandardManager to check that the behaviour is correct and I can see it persisting the session data during shutdown. I am running on Mac OS X 10.6.7 with Java 1.6.0_26, although I doubt that is relevant.
Sorry for the confusion. After some more testing, session persistence appears to work correctly when Virgo is launched from the command line. When it is started using the Virgo Tooling inside STS, the issue can be reproduced when Virgo is restarted using the Restart command. Therefore, this may be a Virgo Tooling bug. I will attach the Eclipse project for convenience.
Created attachment 200003 [details] Eclipse project to reproduce the bug
Thanks for the clarification. Targetting 3.5 on the assumption that a tooling fix will be needed.
I re-tested on the latest tooling snapshot and the problem is no longer recreatable. A number of fixes have gone in since this was last tested, so I presume it is fixed. I tried with VTS 3.0.0.M05 which was what I used to reproduce the problem originally and with VTS 3.6.0.RELEASE.
I guess FIXED is more appropriate than WORKSFORME as it definitely used to fail.