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

          日歷

          <2012年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          搜索

          •  

          最新評論

          java.io.InvalidClassException解決

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

          報錯現象

          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 =  改成遠程的就行了,如果沒有的話就加上這句。

           

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

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

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

          3.該類沒有可訪問的無參數構造方法


           

           

           


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


          網站導航:
           
          主站蜘蛛池模板: 西盟| 金秀| 嘉兴市| 洛川县| 永春县| 遂宁市| 呼伦贝尔市| 伊宁市| 喀喇沁旗| 海丰县| 景洪市| 山阳县| 龙陵县| 呼图壁县| 保定市| 连山| 九龙县| 玉林市| 平阴县| 凤阳县| 临猗县| 台东县| 玉门市| 郸城县| 密山市| 冕宁县| 泰宁县| 西安市| 吉林省| 紫阳县| 海盐县| 柳江县| 河北省| 利辛县| 那坡县| 天等县| 新竹市| 科技| 原平市| 阿城市| 绍兴市|