使用hibernate框架时出现异常No CurrentSessionContext configured!
因为可能你的HibernateUtil.java封装getSession()方法时使用的是sessionFactory.getCurrentSession();
把它改成sessionFactory.openSession();
或者在hibernate.cfg.xml配置文件上加上:
<property name="hibernate.current_session_context_class">thread</property>
就不会出现报错了