Cannot determine embedded database driver class for database type NONE

SpringBoot在启动过程中可能会报如下错误:

     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})

猜你喜欢

转载自xiaochuang.iteye.com/blog/2391733