Failed to configure a DataSource 'url' attribute问题解决

才写了一行代码又报错了..


***************************
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).

Disconnected from the target VM, address: ‘127.0.0.1:58792‘, transport: ‘socket‘

Process finished with exit code 0

未指定“url”属性,无法配置嵌入的数据源。

原因:由于添加了数据库组件,所以autoconfig会去读取数据源配置,新建的项目还没有配置数据源,所以会导致异常出现。

解决办法:

在启动类添加如下内容

即:@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

----------------

转自:悟世君子的博客

Failed to configure a DataSource 'url' attribute问题解决

原文地址:https://www.cnblogs.com/zilongmao/p/10351315.html

时间: 2024-10-08 03:34:32

Failed to configure a DataSource 'url' attribute问题解决的相关文章

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

springboot报错截图: 报错原因: 使用多数据源,第一次运行前要install 解决方法: 没错,就是这个鬼东西: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured 原文地址:https://www.cnblogs.com/biaogejiushibiao/p/9926214.html

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

解决方案: @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) 作用://取消数据库配置 但是 在用到数据库的时候记得将他改为 @SpringBootApplication , 否则会报错:如下org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxController':

SpringBoot使用mybatis,发生:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured

最近,配置项目,使用SpringBoot2.2.1,配置mybatis访问db,配好后,使用自定义的数据源.启动发生: APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason

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

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 Description: Failed to configure a DataSource: 'url' attribute is not

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

启动springboot的时候莫名其妙出现这个错误,我properties里面也没配置数据源啥的,但就是出现这个错误 解决方法: 在启动类上加@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}) 即在@SpringBootApplication上加(exclude= {DataSourceAutoConfiguration.class}) 其他因为数据源的问题出现的这个错误网上好多,这里不赘述. 奇葩的Faile

第一个springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

报错内容具体如下 *************************** 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

Spring Boot 2.1.7 启动项目失败,报错: "Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured."

一开始按照网上的很多解决办法是: 启动类头部声明@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}),但是这样会排除掉我自己的数据库配置, 检查了很多地方都没发现问题在哪里,最后自己猜想不论怎么修改application.yml文件,都不生效,是不是因为这个配置文件就没有被加载到? 带着这个想法我就去网上搜了一下问题,有个问题看到了target目录的作用,就去想了一下是不是application.yml文件没有被

springboot 新工程报错 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

错误日志 ... ... Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-04-02 12:52:47.306 ERROR 22036 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLIC

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

有的时候,dubbo的消费者不需要配置数据源: 在子项目引入父项目依赖的时候 同时引入了自动配置数据源的依赖,有没有配置数据源的时候,就会报错: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. 两种解决方法: 如果不需要配置数据源,又需要使用依赖,可以使用第一种方法 取消数据源的自动配置: @SpringBootAp