IDEA错误提示:
Exception in thread “main”
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘userController’: Injection of resource
dependencies failed; nested exception is
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
named ‘userService’ is expected to be of type
‘com.cqust.biz.BankCardBizImpl’ but was actually of type
‘com.sun.proxy.$Proxy13’ at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:321)
提示图片:
解决方案:
提示的意思就是在写controller装配的时候多添加了一个装配方式,需要将该装配方式去掉,就不会继续报错了。
正确配置: