Reason: Failed to determine a suitable driver class springboot配置了数据源,启动包url找不到 Reason: Failed to
自学springboot头疼啊,明明已经配置了数据源,但是在启动项目的时候总是报上面的错误。
网上最多的一种就是给springApplication添加 Exculed 关闭 DataAutowired 就是排除数据源扫描。
但是,这样做的后果是什么?
就是后面mapper不能扫描到。而且我明明配置了数据源,凭啥不给我启动??
后来我实在百度不到方法就自己试
先把application.properties改成application.yml文件,发现可以,扫描到我的数据源了。但是application.properties里的其他配置项却扫不到了。因为我只在yml里面配置了数据源,其他的数据没有配置
这个结果显然不是我想要的
我想着会不会是我项目不完整?或者java虚拟机中我的代码有残缺??
我重新build项目
就是在
然后问题就完美解决了!!!
开心????
如果有人遇到了这样的问题,可以试试,或者把properties改成yml,就是麻烦点