这个错误我整理了  半天才发现问题的存在。

尝试了网上的很多办法,但是最后都没有达到效果。

包括这两种:

第一种: web.xml种的配置

<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

第二种是  修改readonly

 

如果两种方式都不行的话,请试试这种方式

检查你的事务管理设置。我的注释中的是正确的。

<!-- <aop:pointcut expression="execution(* com.cqut.computer.wang.future_mail.dao.*.*(..))"
/>

 

相关文章: