hibernate配置问题

来源:百度知道 编辑:UC知道 时间:2024/07/01 07:23:31
问题如下:
在HibernateUtil中代码如下:
public class HibernateUtil {
private static final SessionFactory sessionFactory;

static {
try {
// Create the SessionFactory
sessionFactory = new Configuration().configure()
.buildSessionFactory();
} catch (Throwable ex) {
ex.printStackTrace();
System.out.println("Initial SessionFactory creation failed.");
throw new ExceptionInInitializerError(ex);
}
}

public static final ThreadLocal tLocalsess = new ThreadLocal();

public static final ThreadLocal tLocaltx = new ThreadLocal();

/*
* getting the thread-safe session for using
*/
public static Session currentSession() {
Session session = (Session) tLocalsess.get();

// open a new one, if none can be found.

到底是还有没有问题啊?难道是提出问题后又自己发现问题了吗?

异常信息呢?

http://hi.baidu.com/%CF%F4%D4%C2%CC%EC%D1%C4/blog/item/4b46f18d45c5df14b21bba64.html

启动Hibernate...自己看看去,

请大异常发出来