SpringBoot项目报错Cannot determine embedded database driver class for database type NONE

原因:
Cannot determine embedded database driver class for database type NONE
这是因为spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。
 
方案:
在Application类上增加@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
阻止spring boot自动注入dataSource bean
原文地址:https://www.cnblogs.com/striver-zhu/p/8660395.html