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
-----------------------------------分 ------------------------------------隔 ------------------------------------线 --------------------------------------