报错信息如下:

org hibernate HibernateException No CurrentSessionContext configured

org hibernate HibernateException No CurrentSessionContext configured

解决方法:

问题原因是getCurrentSession()出现了问题
在hibernate.cfg.xml(hibernate的核心配置文件)文件中加入下列代码:

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2021-09-02
  • 2021-05-21
  • 2022-12-23
  • 2021-10-02
  • 2021-09-12
相关资源
相似解决方案