Hi Jean-Christophe, can you try out this JAR, it sets the context class
loader upon attribute realization.
http://people.apache.org/~fhanik/catalina-cluster.jar
filip
Jean-Christophe Praud wrote:
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(ClusterAppSessionListener.java:47)
at
common.listeners.ClusterAppSessionListener.attributeAdded(ClusterAppSessionListener.java:26)
at
org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.java:1310)
at
org.apache.catalina.cluster.session.DeltaRequest.execute(DeltaRequest.java:159)
at
org.apache.catalina.cluster.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1565)
at
org.apache.catalina.cluster.session.DeltaManager.messageReceived(DeltaManager.java:1516)
at
org.apache.catalina.cluster.session.DeltaManager.messageDataReceived(DeltaManager.java:1268)
at
org.apache.catalina.cluster.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:85)
at
org.apache.catalina.cluster.tcp.SimpleTcpCluster.receive(SimpleTcpCluster.java:1163)
at
org.apache.catalina.cluster.tcp.ClusterReceiverBase.messageDataReceived(ClusterReceiverBase.java:418)
at
org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java:107)
at
org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(TcpReplicationThread.java:138)
at
org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicationThread.java:69)
What did I miss ?
Regards,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]