Tomcat集群遇到反序列化出错的问题

错误信息:严重: Manager [/kssc]: Unable to receive message through TCP channel
java.io.InvalidClassException: com.kingstar.project.AbstractUser; local class in
compatible: stream classdesc serialVersionUID = 8406738952245021539, local class
 serialVersionUID = 7630078056280811162
        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:560)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:158
2)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:158
2)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
731)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
        at org.apache.catalina.cluster.session.DeltaRequest$AttributeInfo.readEx
ternal(DeltaRequest.java:334)
        at org.apache.catalina.cluster.session.DeltaRequest.readExternal(DeltaRe
quest.java:246)
        at org.apache.catalina.cluster.session.DeltaManager.loadDeltaRequest(Del
taManager.java:697)
        at org.apache.catalina.cluster.session.DeltaManager.handleSESSION_DELTA(
DeltaManager.java:1572)
        at org.apache.catalina.cluster.session.DeltaManager.messageReceived(Delt
aManager.java:1522)
        at org.apache.catalina.cluster.session.DeltaManager.messageDataReceived(
DeltaManager.java:1271)
        at org.apache.catalina.cluster.session.ClusterSessionListener.messageRec
eived(ClusterSessionListener.java:85)
        at org.apache.catalina.cluster.tcp.SimpleTcpCluster.receive(SimpleTcpClu
ster.java:1167)
        at org.apache.catalina.cluster.tcp.ClusterReceiverBase.messageDataReceiv
ed(ClusterReceiverBase.java:426)
        at org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java
:107)
        at org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(Tcp
ReplicationThread.java:138)
        at org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicati
onThread.java:69)

 

 

问题原因调查及确认:

AbstractUser实现了Serializable接口。

两个tomcat中AbstractUser编译后的class版本号不一致导致session同步时反序列化session中AbstractUser对象失败所致。

你可能感兴趣的:(Tomcat集群遇到反序列化出错的问题)