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"/> 如果这篇文章对你有用,麻烦关注一下本人微信公众号,关注送福利哦~ 不定期安利各种插件,编程技巧,编程思想,欢迎交流~