SpringBoot中报错expected at least 1 bean which qualifies as autowire candidate. Dependency annotations:
·
报错:
Unsatisfied dependency expressed through field 'xxxMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.gdata.biz.content.mapper.xxxMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
提示:
expected at least 1 bean which qualifies as autowire candidate
期望至少有1个bean,可以作为自动装配的候选对象
原因:
没有扫描到mapper包
解决方法:
在主启动类上添加扫描mapper包的注解。
@MapperScan("com.xxx.xxx.xxx.mapper")
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)