SpringBoot+Mybatis 启动提示找不到Mapper

控制台报错:

2018-08-06 13:59:42.480  INFO 6496 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-08-06 13:59:42.558 ERROR 6496 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field ioPojoMapper in com.example.controller.IoController required a bean of type 'com.example.mapper.IoPojoMapper' that could not be found.


Action:

Consider defining a bean of type 'com.example.mapper.IoPojoMapper' in your configuration.


Process finished with exit code 1

提示我们找不到Mapper,这种情况,在dao文件上加上@Mapper,将dao层文件和mapper文件放在同一个目录下就可以,经过测试,这好像是springboot的一个bug,需要放在同一个包下才可检测到

以上


版权声明:本文为Demo_Liu原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。