报错:
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")