SpringBoot整合mybatis-plus异常:Unsatisfied dependency expressed through field 'mapper'解决办法


报错信息截取:

Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean 

解决办法:springboot启动类上加 @MapperScan();注解,如下

@SpringBootApplication
@MapperScan(value = "com.xxxxx.xxxx.mapper")
public class ManagesysApplication {

:网上还有一种写法:就是在mapper接口上添加@Mapper注解,然而这种写法并不能解决扫包不全的问题。用上面的做法,指定扫描路径即可。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM