加載net.sf.hibernate出現(xiàn)錯誤

字號:

1. 加載net.sf.hibernate 出現(xiàn)錯誤:
    解決:這就是版本不同的區(qū)別
    將所有程序中的net.sf.hibernate替換為org.hibernate. 但是有例外
    net.sf.hibernate.expression.Expression換為org.hibernate.criterion.Expression
    如果用eclipse,用ctrl+shift+o快捷鍵可以加快速度
    2. the type org.apache.commons.lang.exception.NestableRuntimeException cannot be resolved. It is indirectly referenced from required .clsaa files.
    原因:你正要使用的類調用了另一個類,而這個類又調用了其他類,這種關系可能會有好多層??荚嚧筇崾驹谶@個調用的過程中,某個類所在的包的缺失就會造成以上那個錯誤。
    解決方法:導入缺失的包
    3. XMLOutputter(String,Boolean)undefined
    jdom1.0修改了XMLOutputter()方法,它的參數(shù)寫到一個格式類Format里了:如下
    Format format = Format.getPrettyFormat();
    format.setEncoding(encoding);
    format.setLineSeparator("\r\n");
    XMLOutputter outputter = new XMLOutputter(format);
    //對比以前的是實例化XMLOutputter時用參數(shù)值或變量傳入
    導入jdom0.7即可。