@[TOC](org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘com.example.mapper.UserMapperAnoTest’: Unsatisfied dependency expressed through field ‘userMapperAno’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.example.mapper.UserMapperAno’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
)
今天在复习springboot-mybatis项目时突然遇到此类报错,此类错误一般是没有注入导致的
1.检查主类上面的扫描包是否正确
2.在相应bean上面添加@Mapper进行检查