ITeye博客

No CurrentSessionContext configured

sjsky · 2011-06-19 22:59 · Exception · 编程语言 · Java · Hibernate · Exception · CurrentSessionContext · Markdown

blog迁移至 :http://www.micmiu.com

 

hibernate 配置启动报错,错误信息如下:

 

org.hibernate.HibernateException: No CurrentSessionContext configured!
	at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:540)
	at michael.jdbc.c3p0.C3p0HibernateExample.main(C3p0HibernateExample.java:31)

 

解决办法:在配置文件:hibernate.cfg.xml 添加属性:current_session_context_class

 

<property name="current_session_context_class">thread</property>

 

 

 

转载请注明来自:Michael's blog @ http://sjsky.iteye.com

-----------------------------------分 ------------------------------------隔 ------------------------------------线 --------------------------------------

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。