栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

org.springframework.beans.factory.UnsatisfiedDependencyException

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

org.springframework.beans.factory.UnsatisfiedDependencyException

错误信息
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name ‘indexController’: Unsatisfied dependency expressed through field ‘bookService’; nested exception is org.springframework.beans.factory.
UnsatisfiedDependencyException: Error creating bean with name ‘bookService’:
Unsatisfied dependency expressed through field ‘bookMapper’; nested exception is org.springframework.beans.factory.
NoSuchBeanDefinitionException: No qualifying bean of type ‘com.project.dao.BookMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

我已经是二次入坑了,第一次没有做记录,结果导致第二次又忘了

解决办法
有以下几个原因:

1)service接口实现类上有没有加@Service注解,注解是不是引用的spring的类?不要导错包

2)接口有没有写实现类,实现类是实现的对应接口么?

3)有没有扫描Service所在的包

4)确保代码无误后,再看看包是否下载完整

    查看注入是否正确

6)是否正确配置Listenter(就是这个原因一直在卡我)


        org.springframework.web.context.ContextLoaderListener
    
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/750075.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号