tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel.H...@cec.eu.int
Subject Session restore classloading problem
Date Thu, 24 Oct 2002 14:17:42 GMT
Dear developers, (apologies for the expected crap formatting from outlook)

Just want to know if this is expected behavoir.

I've had some trouble with sessions being restored on tomcat restart when
data stored in the session is an object array.

e.g.

		if (action != null && action.equals("insert"))
		{
			System.out.println("Action was insert - will create
a new one.");
			SomeDataClass[] twoSize = new SomeDataClass[2];
			twoSize[0] = new SomeDataClass();
			twoSize[1] = new SomeDataClass();
			session.setAttribute( "data", twoSize);
		}
		else if (action != null && action.equals("retrieve"))
		{
			SomeDataClass[] twoArray =
(SomeDataClass[])session.getAttribute("data");
			if (twoArray == null)
			{
				System.out.println("I did not get back an
object :-(");
			}
			else
			{
				System.out.println("I got back the object: "
+ twoArray.toString());
			}
		}

On restart of tomcat (with SomeDataClass[] in the session) I get the
following on startup, with the session data trashed:

2002-10-24 13:53:59 StandardManager[/test] Exception loading sessions from
persistent storage java.lang.ClassNotFoundException: [LSomeDataClass;
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1428)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1274)
        at
org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectIn
putStream.java:119)
        at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1503)
        at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1550)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1261)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
        at
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:
1357)
        at
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.j
ava:852)
        at
org.apache.catalina.session.StandardManager.load(StandardManager.java:411)
        at
org.apache.catalina.session.StandardManager.start(StandardManager.java:626)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3496)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
21)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
        at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j
ava:257)

I am running:

Tomcat 4.1 win32 with apache2, default install, minus 8080 listener.

My question is - is this expected behavoir, or should the WebappClassLoader
be handling this compound type of array?

Thanks for any help,

Daniel Hams
DG Trade A4
European Commission
Tel: +32.2.299.96.81
Fax: +32.2.295.38.56
Email: Daniel.Hams@cec.eu.int


--
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