Bug 42662 - Classloader issue for replicated sessions and dynamic proxies
Summary: Classloader issue for replicated sessions and dynamic proxies
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: unspecified
Hardware: Other Linux
: P2 critical (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-14 06:37 UTC by Michael Wyraz
Modified: 2008-05-15 08:20 UTC (History)
0 users



Attachments
Webapp to reproduce the problem (3.82 KB, application/zip)
2007-06-14 06:39 UTC, Michael Wyraz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Wyraz 2007-06-14 06:37:49 UTC
We use 2 tomcats (tomcat 6.0.13) as Cluster with default tcp session
replication. Some webapps contains complex session information including dynamic
generated proxies.

The problem is that the classloader used to deserialize the proxy cannot load
any of the proxy interfaces during initialisation. The result is a
"ClassNotFoundException" but the interface class is pressent.

I will attach a minimal webapp to reproduce the problem. The exception thrown is
below. The exception is thrown, when both tomcats are running and the servlet is
called on one of them (the other tomcat throws the exception).

java.lang.ClassNotFoundException: proxytest.TestProxyInterface
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java:676)
        at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at
org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(DeltaRequest.java:361)
        at
org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.java:255)
        at
org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(DeltaManager.java:619)
        at
org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1363)
        at
org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1320)
        at
org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1083)
        at
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:87)
        at
org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:916)
        at
org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:897)
        at
org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:264)
        at
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
        at
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:110)
        at
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
        at
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
        at
org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:241)
        at
org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:225)
        at
org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:185)
        at
org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:88)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Comment 1 Michael Wyraz 2007-06-14 06:39:14 UTC
Created attachment 20347 [details]
Webapp to reproduce the problem

Deploy the webapp on a cluster of at least 2 nodes (distributable context,
replicated session). Call one node's url and watch the log of the other.
Comment 2 Naaman Lifshitz 2008-04-03 06:35:08 UTC
I have encountered the same problem. Here is my post in the support forum, that includes details, as well as code that can help reproduce the problem.

http://www.nabble.com/Problem-serializing-JDK-dynamic-proxies-td16467407.html

Hope this helps,
Naaman

Comment 3 Filip Hanik 2008-04-05 15:02:58 UTC
Fixed in trunk
http://svn.apache.org/viewvc?view=rev&revision=645184
Will propose backport for 6.0.x branch

Filip
Comment 4 Filip Hanik 2008-05-15 08:20:06 UTC
patch applied to 6.0.x branch, will be available 6.0.17