【轉】:http://10000001.blog.51cto.com/4600383/1405230
問題描述:在S2SH整合Shiro框架的時候,使用Shiro註解時,Struts2執行了Action之後出現了這問題:
java.lang.NoSuchMethodException: com.sun.proxy.$Proxy25
即:使用到了代理對象時找不到對應的方法。
解決方法:經過多次測試,發現需要修改兩個地方
①:DefaultAdvisorAutoProxyCreator增加proxyTargetClass屬性爲true
1
2
3
4
|
<!-- 開啓註解--> <bean
class = "org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
depends-on= "lifecycleBeanPostProcessor" > <property name= "proxyTargetClass"
value= "true" ></property> </bean> |
②:aspectj-autoproxy增加proxyTargetClass屬性爲true
1
|
<aop:aspectj-autoproxy proxy-target- class = "true" /> |