hibernate 配置启动报错,错误信息如下:
1 2 3 |
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
1 |
<property name="current_session_context_class">thread</property> |
原创文章,转载请注明: 转载自micmiu – 软件开发+生活点滴[ http://www.micmiu.com/ ]
本文链接地址: http://www.micmiu.com/exception/no-currentsessioncontext-configured/
0 条评论。