No CurrentSessionContext configured 错误解决
No CurrentSessionContext configured 异常解决
在以上hibernate的配置文件中添加上面的配置即可!
Exception in thread "main" org.hibernate.HibernateException: No CurrentSessionContext configured!
这个异常发生的原因是因为在hibernate.cfg.xml中没有设置:
<property name="current_session_context_class">thread</property>
在以上hibernate的配置文件中添加上面的配置即可!