当前位置:Gxlcms > 数据库问题 > springboot启动时报错Cannot determine embedded database driver class for database type NONE解决办法

springboot启动时报错Cannot determine embedded database driver class for database type NONE解决办法

时间:2021-07-01 10:21:17 帮助过:3人阅读

解决办法:

1,在pom文件中加h2引用

 

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>

 

技术图片

 

 2.在启动类上加上

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})

技术图片

 

 3,以上解决办法只是针对该springboot应用不与数据库之间有交互的场景下,使用,

若应用与数据库有交互,那么@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class}) 是不能用的!!!!!

 

springboot启动时报错Cannot determine embedded database driver class for database type NONE解决办法

标签:alt   jpa   dde   img   style   can   ase   数据库   toc   

人气教程排行