1. 加載net.sf.hibernate 出現(xiàn)錯(cuò)誤:
解決:這就是版本不同的區(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.
原因:你正要使用的類調(diào)用了另一個(gè)類,而這個(gè)類又調(diào)用了其他類,這種關(guān)系可能會(huì)有好多層??荚嚧筇崾驹谶@個(gè)調(diào)用的過(guò)程中,某個(gè)類所在的包的缺失就會(huì)造成以上那個(gè)錯(cuò)誤。
解決方法:導(dǎo)入缺失的包
3. XMLOutputter(String,Boolean)undefined
jdom1.0修改了XMLOutputter()方法,它的參數(shù)寫到一個(gè)格式類Format里了:如下
Format format = Format.getPrettyFormat();
format.setEncoding(encoding);
format.setLineSeparator("\r\n");
XMLOutputter outputter = new XMLOutputter(format);
//對(duì)比以前的是實(shí)例化XMLOutputter時(shí)用參數(shù)值或變量傳入
導(dǎo)入jdom0.7即可。
解決:這就是版本不同的區(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.
原因:你正要使用的類調(diào)用了另一個(gè)類,而這個(gè)類又調(diào)用了其他類,這種關(guān)系可能會(huì)有好多層??荚嚧筇崾驹谶@個(gè)調(diào)用的過(guò)程中,某個(gè)類所在的包的缺失就會(huì)造成以上那個(gè)錯(cuò)誤。
解決方法:導(dǎo)入缺失的包
3. XMLOutputter(String,Boolean)undefined
jdom1.0修改了XMLOutputter()方法,它的參數(shù)寫到一個(gè)格式類Format里了:如下
Format format = Format.getPrettyFormat();
format.setEncoding(encoding);
format.setLineSeparator("\r\n");
XMLOutputter outputter = new XMLOutputter(format);
//對(duì)比以前的是實(shí)例化XMLOutputter時(shí)用參數(shù)值或變量傳入
導(dǎo)入jdom0.7即可。