If you got a DynamicProxy inside the session, catalina fails to load this object. Suggested fix: (tested just a little bit, not realy) in: org.apache.catalina.util.CustomObjectInputStream overwrite the method protected Class resolveProxyClass(String[] interfaces) with the implementation of java.io.ObjectInputStream except the first line ClassLoader latestLoader = classLoader; // instead of ClassLoader latestLoader = latestUserDefinedLoader(); this seams to work..
I'd prefer something along the lines of the patch below. Could you test this (or attach a simple test case to this bug report). If it works, I'll commit it. Index: catalina/src/share/org/apache/catalina/util/CustomObjectInputStream.java =================================================================== RCS file: /home/cvs/jakarta-tomcat- catalina/catalina/src/share/org/apache/catalina/util/Cu stomObjectInputStream.java,v retrieving revision 1.3 diff -u -r1.3 CustomObjectInputStream.java --- catalina/src/share/org/apache/catalina/util/CustomObjectInputStream.java 27 Feb 2004 14:58:50 -0000 1.3 +++ catalina/src/share/org/apache/catalina/util/CustomObjectInputStream.java 16 May 2004 13:35:18 -0000 @@ -72,5 +72,27 @@ return Class.forName(classDesc.getName(), false, classLoader); } + /** + * Return a proxy class that implements the interfaces named in a proxy + * class descriptor. Do this using the class loader assigned to this + * Context. + */ + protected Class resolveProxyClass(String[] interfaces) + throws IOException, ClassNotFoundException { + + ClassLoader originalClassLoader = + Thread.currentThread().getContextClassLoader(); + + // Set thread to use context class loader + Thread.currentThread().setContextClassLoader(classLoader); + + // Use super class to do all the real work + Class clazz = super.resolveProxyClass(interfaces); + + // Swap back to original class loader + Thread.currentThread().setContextClassLoader(originalClassLoader); + + return clazz; + } }
My sugested patch above doesn't work. However, I have committed an alternative patch that does. The patch was also ported to TC5.5.x