Tomcat集群遇到反序列化出错的问题
错误信息:严重: Manager [/kssc]: Unable to receive message through TCP channel
java.io.InvalidClassException:com.kingstar.project.AbstractUser;localclassin
compatible:streamclassdescserialVersionUID=8406738952245021539,localclass
serialVersionUID=7630078056280811162
atjava.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:560)
atjava.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:158
2)
atjava.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
atjava.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:158
2)
atjava.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
atjava.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
731)
atjava.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
atorg.apache.catalina.cluster.session.DeltaRequest$AttributeInfo.readEx
ternal(DeltaRequest.java:334)
atorg.apache.catalina.cluster.session.DeltaRequest.readExternal(DeltaRe
quest.java:246)
atorg.apache.catalina.cluster.session.DeltaManager.loadDeltaRequest(Del
taManager.java:697)
atorg.apache.catalina.cluster.session.DeltaManager.handleSESSION_DELTA(
DeltaManager.java:1572)
atorg.apache.catalina.cluster.session.DeltaManager.messageReceived(Delt
aManager.java:1522)
atorg.apache.catalina.cluster.session.DeltaManager.messageDataReceived(
DeltaManager.java:1271)
atorg.apache.catalina.cluster.session.ClusterSessionListener.messageRec
eived(ClusterSessionListener.java:85)
atorg.apache.catalina.cluster.tcp.SimpleTcpCluster.receive(SimpleTcpClu
ster.java:1167)
atorg.apache.catalina.cluster.tcp.ClusterReceiverBase.messageDataReceiv
ed(ClusterReceiverBase.java:426)
atorg.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java
:107)
atorg.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(Tcp
ReplicationThread.java:138)
atorg.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicati
onThread.java:69)问题原因调查及确认:
AbstractUser实现了Serializable接口。
两个tomcat中AbstractUser编译后的class版本号不一致导致session同步时反序列化session中AbstractUser对象失败所致。