java.io.InvalidClassException 实体类序列化问题

2010-07-27 19:12:55,004 ERROR [com.danga.MemCached.MemCachedClient] - <实体类(pojo); local class incompatible: stream classdesc serialVersionUID = 812952289507407815, local class serialVersionUID = -7688346538714640295>
java.io.InvalidClassException: 实体类(pojo); local class incompatible: stream classdesc serialVersionUID = 812952289507407815, local class serialVersionUID = -7688346538714640295
        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
        at java.util.HashMap.readObject(HashMap.java:2365)
        at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
        at com.danga.MemCached.MemCachedClient.get(MemCachedClient.java:1364)
        at com.danga.MemCached.MemCachedClient.get(MemCachedClient.java:1209)
        at com.laoer.session.SessionService.getSession(SessionService.java:88)
        at com.laoer.session.HttpSessionSidWrapper.<init>(HttpSessionSidWrapper.java:22)
        at com.laoer.session.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:22)
        at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:236)
        at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:245)
       
原因是在resin部署了两个项目,两个项目中,都有user表的实体类,然后两个项目的序列号不一致,估计是同在一个jvm中,导致反序列化出问题,回来把序列号都改为一致的就没问题啦!
第一次碰到这样的情况,如果一个一个项目的部署,我想这问题不会出现!值得保留!

你可能感兴趣的:(java,jvm,servlet,memcached,sun)