No qualifying bean of type ‘com.example.book.mapper.BooksMapper‘ available: expected at least 1 bean

具体报错:

No qualifying bean of type 'com.example.book.mapper.BooksMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

翻译:

没有这个“com..xxMapper”类型的合格bean,可供mapper.xx映射器可用:希望至少有1个bean,它才可以作为自动连线

一般报这个错就是没配置好mapper的映射

根据报错找到  报错的mapper

加上

@Mapper 注解No qualifying bean of type ‘com.example.book.mapper.BooksMapper‘ available: expected at least 1 bean_第1张图片

 重新启动

成功了 

你可能感兴趣的:(测试开发-Spring,boot,java,mybatis,spring,boot,mapper)