这个是thread配置写错,hiberante3支持`在
<prop key="current_session_context_class">thread</prop>
这个写法在hibernate3支持,hibernate5应该这样写
<property name="hibernate.current_session_context_class">org.springframework.orm.hibernate5.SpringSessionContext</property>
还有个问题是openSession不能使用事务,getCurrentSession可以正常使用事务
转载此人链接