在学习Spring-boot-mybatis时,报错A component required a bean of type 'com.sirifeng.testmybatis.mapper.BookMapper' that could not be found.
后来发现是在启动器上没有添加注解
@MapperScan("com.sirifeng.testmybatis.mapper")
如有这个错误的可以看一下是不是因为这个原因。
在学习Spring-boot-mybatis时,报错A component required a bean of type 'com.sirifeng.testmybatis.mapper.BookMapper' that could not be found.
后来发现是在启动器上没有添加注解
@MapperScan("com.sirifeng.testmybatis.mapper")
如有这个错误的可以看一下是不是因为这个原因。
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。