APPLICATION FAILED TO START


Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

项目启动失败,导致原因大致有几种
1、配置文件关于数据库的配置信息有误
2、配置文件没有读取到
3、在启动类上面添加注解

但是网上的方案都无效,根据自查是删除了POM文件中的依赖导致

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-config</artifactId>
        <version>2.0.0.RELEASE</version>
    </dependency>

将此依赖添加回到项目即可解决问题


Lougacen_Jc
7 声望0 粉丝