hibernate.cfg.xml的有关问题
hibernate.cfg.xml的问题Java codepackage tcimport java.util.Iteratorimport org.hibernate.cfg.Confi
hibernate.cfg.xml的问题
Java codepackage tc;import java.util.Iterator;import org.hibernate.cfg.Configuration;public class GetTableName { public void show(){ Configuration cf = new Configuration(); Iterator it = cf.getTableMappings(); while(it.hasNext()){ String s = (String)it.next(); System.out.println(s); } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub }}
再myeclipse中写上面的类,没有报错,但是再web工程中的实际运行后提示错误 在行 Configuration cf = new Configuration();
报错,提示为java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
这是为什么
[解决办法]hibernate.jar你导入了没有
[解决办法]