spriing boot 启动报错: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因缺少相关的信息就会报错。

 因为我仅仅只是使用spring boot来写一些很简单的例子来学习它,在Application类上增加

 @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})

阻止spring boot自动注入dataSource beanspriing boot 启动报错:Cannot determine embedded database driver class for database type NONE

相关文章:

  • 2021-08-29
  • 2021-08-17
  • 2021-06-01
  • 2022-02-06
猜你喜欢
  • 2021-10-13
  • 2021-06-23
  • 2021-11-13
  • 2022-12-23
  • 2021-10-01
相关资源
相似解决方案