第二章的Hibernate怎么调不通啊?出现下列错误!

hdhhb
05-04-25 0 186

我使用下列语句初始化
try {
// Create the SessionFactory
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
//log.error("Initial SessionFactory creation failed.", ex);
throw new ExceptionInInitializerError(ex);
}
调试时出现一下错误。
java.lang.ExceptionInInitializerError
at hibernatetest.HibernateUtil.<clinit>(HibernateUtil.java:25)

总是sessionFactory初始化不成功!