本文主要是介绍Bean named ‘userService‘ is expected to be of type ‘com.cqust.biz.BankCardBizImpl‘ but was actually,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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装配的时候多添加了一个装配方式,需要将该装配方式去掉,就不会继续报错了。
正确配置:
这篇关于Bean named ‘userService‘ is expected to be of type ‘com.cqust.biz.BankCardBizImpl‘ but was actually的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!