Can error when springboot start not determine embedded database driver class for database type NONE solution

 

 Start springboot given below:

 

 

 

Error reason: automatically inject data source and configuration jpa start when springboot

Solution:

1, in the pom file references plus h2

 

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

 

 

 2. On the startup class plus

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

 

 3, the above solution is just not there for that springboot between the database and application interaction scenario, use,

If the application has to interact with the database, then @SpringBootApplication ( the exclude = {DataSourceAutoConfiguration. Class, HibernateJpaAutoConfiguration. Class }) can not be used! ! ! ! !

 

Guess you like

Origin www.cnblogs.com/liqiang0728/p/11777405.html