Good Morning Filip-

I noticed I had similar exceptions caused when I switched my base JVM from 1.42 to 1.5..resolved by recompiling all classes to match expected JVM signature of ClassLoader I agree with your direction to understand which ClassLoader is being invoked- A good tutorial to understand which classes are being invoked by Tomcat is located here
http://tomcat.apache.org/tomcat-4.1-doc/class-loader-howto.html

Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- From: "Filip Hanik - Dev Lists" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Sunday, May 21, 2006 7:58 AM
Subject: Re: ClassCastException on cluster deserialization


what does line ClusterAppSessionListener.java:47 do?
can you send us a test case, could be possible that the context classloader isn't set, hence the loading is failing.

java.lang.ClassCastException: com.package1.subpackage1.GW
at common.listeners.ClusterAppSessionListener.printSessionInfo(ClusterAppSessionListener.java:47) at common.listeners.ClusterAppSessionListener.attributeAdded(ClusterAppSessionListener.java:26) at org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.java:1310)

Filip

Jean-Christophe Praud wrote:
No. This a specific class for my webapp. It is located in the webapp's /classes tree, and is instantiated only once per session.

Tim Lucia wrote:

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,







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

Reply via email to