Could not autowire. No beans of ‘DataSource’ type found.如何解决
刚开始使用SpringBoot,遇到了小问题——定义了如下对象:
@Autowiredprivate DataSource dataSource;
却报错提示:Could not autowire. No beans of ‘DataSource’ type found. 经过查资料,在File->Settings->Plugins中找到并下载了Mybatis Plugins插件,居然马上不报错了,神奇! 具体原理查找了资料也没看明白~ 好用就对啦
Could not autowire. No beans of ‘DataSource’ type found.如何解决刚开始使用SpringBoot,遇到了小问题——定义了如下对象: @Autowired private DataSource dataSource;却报错提示:Could not autowire. No beans of ‘DataSource’ type found.经过查资料,在File->Settings->Plugins中找到并下载了Mybatis