下面是具体的异常信息:
[org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.service.UserService com.controller.UserController.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.dao.UserDao com.service.Impl.UserServiceImpl.userDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.dao.UserDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}<spanstyle="font-family:'MicrosoftYaHei',Verdana,sans-serif,宋体;font-size:13.3333px;line-height:22px;background-color:#FFFFFF;">Causedby:java.lang.reflect.MalformedParameterizedTypeException</span>
检查依赖的jar包有没有冲突,jar版本之类的真的是jar包版本问题呢、项目是参照一个博客写的,博主是能跑通的,jar包应该不会冲突吧配置文件里面出了问题看不来哪里有问题呢
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:13.3333px;background-color:#FFFFFF;"><spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:13.3333px;background-color:#FFFFFF;">没有叫userDao的bean
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:13.3333px;background-color:#FFFFFF;">com.dao.UserDao]foundfordependency:expectedatleast1beanwhichqualifiesasautowirecandidateforthisdependency.Dependencyannotations:
老哥,我也是这个问题,你解决了没?
jar包冲突,具体哪个和哪个冲突没有找出来,重新从其他项目更新了jar包就好了,前提是我其他配置都是正确的哈、
如何解决
<divclass='ref'>
老哥,我也是这个问题,你解决了没?
<divclass='ref'>
老哥,我也是这个问题,你解决了没?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。