posts - 35, comments - 0, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          java.io.InvalidClassException解決

          Posted on 2012-06-26 09:51 timelyxyz 閱讀(1086) 評論(0)  編輯  收藏

          報錯現(xiàn)象

          Oops: JPAQueryException
          An unexpected error occured caused by exception JPAQueryException: Error while executing query select t from TurnedIn t, Notification n  where n.itemId=t.id and n.type=? and n.receiver.id=? and n.isDeleted=false group by t order by t.createTime desc: org.hibernate.type.SerializationException: could not deserialize
          ...
          Caused by: java.io.InvalidClassException: models.member.Member; local class incompatible: stream classdesc serialVersionUID = 8996579512119659486, local class serialVersionUID = -7513555048418418149

          異常原因

          本地和遠程的member序列化后的serialVersionUID不

          解決方法

          將本地的序列化的類中的版本號(serialVersionUID )改成和遠程中一樣,在本地的序列化類里的private static final long serialVersionUID =  改成遠程的就行了,如果沒有的話就加上這句。

           

          關(guān)于“org.hibernate.type.SerializationException: could not deserialize”,我查了很多的資料,大概有以下幾個原因:

          1.該類的序列版本號與從流中讀取的類描述符的版本號不匹配(jdk版本更換會造成這個問題)

          2.該類包含未知數(shù)據(jù)類型(hibernate配置文件中未指定數(shù)據(jù)類型)

          3.該類沒有可訪問的無參數(shù)構(gòu)造方法


           

           

           


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 洪湖市| 建水县| 沧州市| 教育| 宁陵县| 刚察县| 略阳县| 安国市| 公安县| 古田县| 伊通| 中西区| 门头沟区| 天气| 莱阳市| 诸城市| 寿阳县| 北辰区| 雷山县| 定南县| 湛江市| 砀山县| 塔城市| 京山县| 抚顺县| 江达县| 绥棱县| 交口县| 那坡县| 巴彦淖尔市| 榆林市| 伊川县| 阿瓦提县| 青浦区| 祁阳县| 民乐县| 沂南县| 平阴县| 章丘市| 海宁市| 万安县|