conflict with automatic session serialization by tomcat?

From: Twan Kogels (twa..wansoft.com)
Date: Tue Jul 06 2004 - 13:44:31 EDT

  • Next message: Twan Kogels: "Re: conflict with automatic session serialization by tomcat?"

    Hello,

    I'm currently in the process of getting
    cayenne/struts/velocity/velocitytools to work in jbuilder9. That's a lot of
    work but i almost got it right.

    There is one thing i can't figure out:
    Tomcat 4.x is saving (serialize) objects which are in session when tomcats
    shutsdown. The session data is saved into a file named "SESSIONS.ser". This
    file is loaded and session data is recovered when tomcats starts again.

    There seems to be a conflict with cayenne here. I'm using a
    WebApplicationListener to get the datacontext up and running like described
    here:
    <http://www.objectstyle.org/cayenne/userguide/deploy/web-application.html>.

    This works fine, but when i shutdown tomcat and restart tomcat a exception
    occurs:

    StandardManager[/proj]: Exception loading sessions from persistent storage
    java.lang.ExceptionInInitializerError
            at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
            at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1513)
            at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:45)
            at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:169)
            at java.security.AccessController.doPrivileged(Native Method)

    This means that the session data saved to disk can't be loaded. After this
    exception occurs very strange things happen, for example cayenne can't find
    the cayenne.xml.

    My solution is to delete the "SESSIONS.ser" when tomcat shutsdown, but
    thats a bit dirty.

    Does anybody know a solution to this problem? or maybe a way to turn off
    the automatic serialisation of session data by tomcat? (just for
    development purposes ;-)

    Cheers,
    Twan Kogels



    This archive was generated by hypermail 2.0.0 : Tue Jul 06 2004 - 13:42:17 EDT