<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    2008年9月9日

    NonUniqueObjectException

    org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session

    首先看看這個類:
    //$Id: NonUniqueObjectException.java,v 1.4 2005/02/12 07:19:50 steveebersole Exp $
    2
    package org.hibernate;
    3
    4 import java.io.Serializable JavaDoc;
    5
    6 import org.hibernate.pretty.MessageHelper;
    7
    8 /**
    9  * This exception is thrown when an operation would
    10  * break session-scoped identity. This occurs if the
    11  * user tries to associate two different instances of
    12  * the same Java class with a particular identifier,
    13  * in the scope of a single <tt>Session</tt>.
    14  *
    15  * @author Gavin King
    16  */

    17 public class NonUniqueObjectException extends HibernateException {
    18     private final Serializable JavaDoc identifier;
    19     private final String JavaDoc entityName;
    20
    21     public NonUniqueObjectException(String JavaDoc message, Serializable JavaDoc id, String JavaDoc clazz) {
    22         super(message);
    23         this.entityName = clazz;
    24         this.identifier = id;
    25     }
    26
    27     public NonUniqueObjectException(Serializable JavaDoc id, String JavaDoc clazz) {
    28         this("a different object with the same identifier value was already associated with the session", id, clazz);
    29     }
    30
    31     public Serializable JavaDoc getIdentifier() {
    32         return identifier;
    33     }
    34
    35     public String JavaDoc getMessage() {
    36         return super.getMessage() + ": " +
    37             MessageHelper.infoString(entityName, identifier);
    38     }
    39
    40     public String JavaDoc getEntityName() {
    41         return entityName;
    42     }
    43
    44 }


    解決方案:
         this..getSession().clear();

    posted @ 2008-09-25 17:07 bill 閱讀(896) | 評論 (0)編輯 收藏

    SSH整合中的問題

    Error Creating SessionFactory java.lang.SecurityException: class"org.apache.commons.collections.SequencedHashMap"'異常的解決方案

    本人用 MyEclipse 6.0.0 開發 Struts + Hibernate應用的時候,單獨測試Hibernate的類沒有問題,但是當Web層和Struts整合后,就拋出如下異常:
    %%%%Error Creating SessionFactory %%%% java.lang.SecurityException: class"org.apache.commons.collections.SequencedHashMap"'s signer informationdoes not match signer information of other classes in the same package

       原因是myeclipse  6.0的jar包問題。這個是myeclipse沒有做好嚴格的測試。

       網上好多人說是commons-collectionsXXX.jar的問題。我也不知道。我是把所有的myeclipse生成的jar都remove buildpath 了。
       我又自己添加的jar。就OK!!!!

    posted @ 2008-09-09 21:36 bill 閱讀(230) | 評論 (0)編輯 收藏

    <2008年9月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    導航

    統計

    常用鏈接

    留言簿(1)

    隨筆分類(2)

    隨筆檔案(4)

    相冊

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 伊人久久五月丁香综合中文亚洲 | 亚洲色偷偷狠狠综合网| 五月天婷婷免费视频| 久久精品国产69国产精品亚洲 | 亚洲v高清理论电影| 999zyz**站免费毛片| 国产网站免费观看| 中文字幕在线免费看| 亚洲国产精品综合一区在线 | 亚洲欧美国产欧美色欲| 91嫩草私人成人亚洲影院| 亚洲午夜无码久久久久| 国产精品深夜福利免费观看| 国产妇乱子伦视频免费| 国产精品免费AV片在线观看| 一级女性全黄生活片免费看| 国产AV无码专区亚洲AV麻豆丫| 精品亚洲成在人线AV无码| 一出一进一爽一粗一大视频免费的| tom影院亚洲国产一区二区| 久久亚洲AV成人出白浆无码国产 | 四虎永久在线精品免费一区二区 | 操美女视频免费网站| 亚洲美女免费视频| 日韩免费高清大片在线| 免费国产99久久久香蕉| 中文字幕的电影免费网站| 精品乱子伦一区二区三区高清免费播放| 精品女同一区二区三区免费播放| 亚洲码欧美码一区二区三区| 亚洲国产日韩综合久久精品| 中文字幕在线观看亚洲视频| 亚洲综合久久精品无码色欲 | 最近中文字幕mv免费高清视频7| 国产免费丝袜调教视频| 在线观看H网址免费入口| 久久久久久精品免费免费自慰| 最近最新高清免费中文字幕| 最近中文字幕2019高清免费| 久久久久久曰本AV免费免费| 免费观看激色视频网站bd|