我无法创建sessionFactory。它引发了一个例外。请帮我解决一下:
public class HibernateUtil<ServiceRegistryBuilder> {
private static final SessionFactory sessionFactory;
static{
try{
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
}catch (Throwable ex) {
System.err.println("Session Factory could not be created." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}