admin管理员组文章数量:1530517
Error creating bean with name 'helloController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean 'com.cloud.xp.manager.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Error creating bean with name 'helloController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean 'com.cloud.xp.manager.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
以上问题可能是由于:
一、在Service实现类上未添加注解
二、在Service实现类上添加了注解,但是仍然报错那么可能是由于未在springmvc.xml中为添加service为自动扫描,那么添加上以下的代码即可:
<!--你自己的service包位置-->
<context:component-scan base-package="xxx.xxx.xxx.service"/>
万物明朗,可可爱爱!
愿你天天有个好心情,热爱每一段代码!
ଘ(੭ˊᵕˋ)੭ (开心) ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)
------不写代码不会凸的小刘
本文标签: beanhelloControllerErrorcreatingexpressed
版权声明:本文标题:Error creating bean with name ‘helloController‘: Unsatisfied dependency expressed through field ‘use 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1725806862a1044144.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论