Are there multiple copies of this class in scope (loaded by different class loaders)? I know if you have some Oracle classes in WEB-INF/lib AND in common/lib, you can get a CCE casting from a oracle.X to an oracle.X as they come from different class loaders.
Tim -----Original Message----- From: Jean-Christophe Praud [mailto:[EMAIL PROTECTED] Sent: Thursday, May 18, 2006 11:02 AM To: users@tomcat.apache.org Subject: ClassCastException on cluster deserialization Hi all, I'm setting up a Tomcat cluster on two servers, and I keep getting a ClassCastException on a session variable (GW). The server which handles the request works well, but the other one can't get the session data. Its GW object seems to be instantiated, valueBound(HttpSessionBindingEvent event) is called, the object is added to the session, then I get the Exception. I tried with Tomcat 5.5.16 and 5.5.17, with several <Sender> replicationMode. My session variable com.package1.subpackage1.GW implements the Serializable interface and contains some classes which are also Serializable. I don't see any Exception from the writeObject or readObject methods on any server. My config : <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster" managerClassName="org.apache.catalina.cluster.session.DeltaManager" expireSessionsOnShutdown="false" useDirtyFlag="true" notifyListenersOnReplication="true"> <Membership className="org.apache.catalina.cluster.mcast.McastService" mcastAddr="228.0.0.4" mcastPort="45564" mcastFrequency="500" mcastDropTime="3000"/> <Receiver className="org.apache.catalina.cluster.tcp.ReplicationListener" tcpListenAddress="auto" tcpListenPort="4001" tcpSelectorTimeout="100" tcpThreadCount="6"/> <Sender className="org.apache.catalina.cluster.tcp.ReplicationTransmitter" replicationMode="synchronous" autoConnect="true" keepAliveTimeout="-1" ackTimeout="15000"/> <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/> <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer" tempDir="/tmp/war-temp/" deployDir="/tmp/war-deploy/" watchDir="/tmp/war-listen/" watchEnabled="false"/> <ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener"/> </Cluster> The Exception's log : 18 mai 2006 16:48:28 org.apache.catalina.cluster.session.DeltaSession setAttribute GRAVE: Session attribute event listener threw exception java.lang.ClassCastException: com.package1.subpackage1.GW at common.listeners.ClusterAppSessionListener.printSessionInfo(ClusterAppSessio nListener.java:47) at common.listeners.ClusterAppSessionListener.attributeAdded(ClusterAppSessionL istener.java:26) at org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.j ava:1310) at org.apache.catalina.cluster.session.DeltaRequest.execute(DeltaRequest.java:1 59) at org.apache.catalina.cluster.session.DeltaManager.handleSESSION_DELTA(DeltaMa nager.java:1565) at org.apache.catalina.cluster.session.DeltaManager.messageReceived(DeltaManage r.java:1516) at org.apache.catalina.cluster.session.DeltaManager.messageDataReceived(DeltaMa nager.java:1268) at org.apache.catalina.cluster.session.ClusterSessionListener.messageReceived(C lusterSessionListener.java:85) at org.apache.catalina.cluster.tcp.SimpleTcpCluster.receive(SimpleTcpCluster.ja va:1163) at org.apache.catalina.cluster.tcp.ClusterReceiverBase.messageDataReceived(Clus terReceiverBase.java:418) at org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java:107) at org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(TcpReplica tionThread.java:138) at org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicationThrea d.java:69) What did I miss ? Regards, -- Jean-Christophe Praud - http://shub-niggurath.com Conseil & Développement Informatique http://www.praud.com Ph'nglui mglw'nafh Cthulhu n'gah Bill R'lyeh Wgah'nagl fhtagn! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]