Spring——AOP com.sun.proxy.$Proxy7 cannot be cast to xxx

xiaoxiao2021-02-28  70

今天在写Spring的AOP时,遇到一个错误com.sun.proxy.$Proxy7 cannot be cast to cn.edu.real.Host

上网查了下得到以下解决办法 

在beans.xml的<aop:config>里加上proxy-target-class="true"

我的代码如下:

就算是注解写aop也是直接加上这句话就可以

转载请注明原文地址: https://www.6miu.com/read-62622.html

最新回复(0)