Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350154

Summary: Session persistence mechanism is not triggered when Virgo restarts
Product: [RT] Virgo Reporter: Brad Chen <brad5620732>
Component: toolingAssignee: Project Inbox <virgo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, glyn.normington, milesg78, mlippert
Version: unspecified   
Target Milestone: 1.0.1.RELEASE   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 368785    
Attachments:
Description Flags
Test web bundle.
none
Eclipse project to reproduce the bug none

Description Brad Chen CLA 2011-06-23 10:49:45 EDT
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.
Comment 1 Brad Chen CLA 2011-06-23 10:52:10 EDT
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.
Comment 2 Brad Chen CLA 2011-06-23 10:54:28 EDT
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.
Comment 3 Glyn Normington CLA 2011-07-20 06:42:31 EDT
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.
Comment 4 Brad Chen CLA 2011-07-20 09:55:22 EDT
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.
Comment 5 Brad Chen CLA 2011-07-20 09:55:49 EDT
Created attachment 200003 [details]
Eclipse project to reproduce the bug
Comment 6 Glyn Normington CLA 2011-07-20 09:58:42 EDT
Thanks for the clarification. Targetting 3.5 on the assumption that a tooling fix will be needed.
Comment 7 Glyn Normington CLA 2013-01-28 07:34:49 EST
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.
Comment 8 Glyn Normington CLA 2013-01-28 07:36:43 EST
I guess FIXED is more appropriate than WORKSFORME as it definitely used to fail.