整合ssh时候遇到的 org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread错误
在整合ssh后写了一个登录的功能,启动后发现直接报错,然后我搜了下资料,发现在service层需要加入@Transactional()
报错截图:
解决方法:加入@Transactional()在service层下面
并且在applicationContext.xml中开启事务注解
<tx:annotation-driven />
n-driven />
这样就完美解决啦!! 记录错误