tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 8295] New: - Session deserialization fails to load all classes correctly
Date Fri, 19 Apr 2002 12:34:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8295>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8295

Session deserialization fails to load all classes correctly

           Summary: Session deserialization fails to load all classes
                    correctly
           Product: Tomcat 4
           Version: 4.0.3 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: matthias.niessen@gaussvip.com


... since the ContextClassLoader isn't set properly at this point of time.

Scenario: One of our base classes uses the following code within a  static{} 
initialisation block:

class CoreObject
{
   static{
     loggingChannel = (LoggingChannel)Class.forName(loggingClassName, true, 
     Thread.currentThread().getContextClassLoader()).newInstance();
   }
}

An instance of this class is serialized as part of the session context. After 
restart of Tomcat 4.03 we receive the following stacktrace:

java.lang.ClassNotFoundException: de.gauss.base.logging.FileLoggingChannel
        at 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.jav
a:1127)
        at 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.jav
a:992)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:195)
        at de.gauss.base.CoreObject.<clinit>(CoreObject.java:101)
        at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
        at 
java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:923)
        at java.io.ObjectStreamClass.access$200(ObjectStreamClass.java:46)
        at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:420)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.io.ObjectStreamClass.init(ObjectStreamClass.java:401)
        at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:112)
        at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:59)
        at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:88)
        at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:59)
        at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:88)
        at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:59)
        at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:88)
        at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:59)
        at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:88)
        at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:566)
        at 
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at 
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1268
)
        at 
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:
810)
        at 
org.apache.catalina.session.StandardManager.load(StandardManager.java:411)
        at 
org.apache.catalina.session.StandardManager.start(StandardManager.java:617)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1104)
        at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3345)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:714)
        at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
        at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
        at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.ja
va:155)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:388)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

This exception changes the way our classes behave. The only known workaround is 
to delete the SESSIONS.ser before we restart Tomcat.
Q: Is there any switch to disable session persistence?

Thanks

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message