代码改变世界

注入错误--注入mapper结果把实体注入进去了

2022-09-15 15:36  ly772186472  阅读(29)  评论(0)    收藏  举报
    @Resource
    private UserAccountService userAccountService;

当时这样注入的

@Resource
    UserAccount userAccount;

 

 ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminUserInfoController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.guigu.srb.core.pojo.entity.UserAccount' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}