首页 > 技术文章 > Cannot determine embedded database driver class for database type NONE

cjblog 2018-05-17 10:24 原文

项目Bug:

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-05-11 16:21:38.046 ERROR 7232 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

附图:

 

 

解决办法:

1)添加jdbc依赖和mysql链接依赖:

<dependency>
   <groupId>mysql</groupId>
   <artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

 

2)web项目中,application.properties 被优先加载 了,但这个文件我这儿没改之前是空的。导致jdbc 配置找不到,driver就是none。所以,要么在persist中加个application,要么在web中加一个,且不为空。

3)启动类中,要排除jpa类。如图:

 

推荐阅读