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