org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'XXService' is expected to be of type 'XXService' but was actually of type 'com.sun.proxy.$ProxyXX'
当Spring不使用service接口时,需要开启cglib。
在spring.xml中添加
<aop:aspectj-autoproxy proxy-target-class="true"/>
如果这篇文章对你有用,可以关注本人微信公众号获取更多ヽ(^ω^)ノ ~