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 34090] New: - org.apache.catalina.util.CustomObjectInputStream causes problems
Date Sun, 20 Mar 2005 21:54:30 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34090>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34090

           Summary: org.apache.catalina.util.CustomObjectInputStream causes
                    problems
           Product: Tomcat 5
           Version: 5.0.28
          Platform: Other
        OS/Version: Windows 2000
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: m.bock@odisys.de


Since tomcat 5.X, we are not able to load persistant sessions on tomcat start.
The attached exception is thrown on tomcat start (s. below).
After investigating the problem, it seems to be caused by the class
org.apache.catalina.util.CustomObjectInputStream. The method defined there

    public Class resolveClass(ObjectStreamClass classDesc)
        throws ClassNotFoundException, IOException {
        return Class.forName(classDesc.getName(), false, classLoader);
    }

doesn't have the fallback of it's superclass java.io.ObjectInputStream

    protected Class resolveClass(ObjectStreamClass desc)
	throws IOException, ClassNotFoundException
    {
	String name = desc.getName();
	try {
	    return Class.forName(name, false, latestUserDefinedLoader());
	} catch (ClassNotFoundException ex) {
	    Class cl = (Class) primClasses.get(name);
	    if (cl != null) {
		return cl;
	    } else {
		throw ex;
	    }
	}
    }

so primitive classes result in a java.lang.ClassNotFoundException.
To prove this, I serialized our complete session-data with writeObject and
readObject. Using the standard classes, no exception was thrown.

Here's the exception:

ClassNotFoundException while loading persisted sessions:
java.lang.ClassNotFoundException: int
java.lang.ClassNotFoundException: int
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:219)
	at
org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:72)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
	at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1402)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1260)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
	at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
	at java.util.ArrayList.readObject(ArrayList.java:547)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
	at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452)
	at de.odisys.bo.Session.readObject(Session.java:930)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
	at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452)
	at de.odisys.bo.ServletSession.readObject(ServletSession.java:216)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
	at
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1342)
	at
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:885)
	at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:416)
	at org.apache.catalina.session.StandardManager.load(StandardManager.java:343)
	at org.apache.catalina.session.StandardManager.start(StandardManager.java:657)
	at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:499)
	at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:315)
	at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:635)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
	at
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
	at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
	at org.apache.commons.digester.Rule.end(Rule.java:276)
	at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
	at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.commons.digester.Digester.parse(Digester.java:1567)
	at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
	at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
	at org.apache.catalina.core.StandardService.start(StandardService.java:480)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message