今天用springboot+mybatis写一个小demo遇到如下错误
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-08 14:11:11.359 ERROR 7300 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field dao in cn.niit.controller.DemoController required a bean of type 'cn.niit.TestMapper.TestMapper' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'cn.niit.TestMapper.TestMapper' in your configuration.
Process finished with exit code 1
它说没有找到这个类,说明这个类没有注入到spring容器,以为是注解没有被扫描,然后各种网上搜以及自己各种重启尝试,了解到@S