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

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

 报错信息如下:

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could_第1张图片

Description:
描述:

Failed to configure a Datasource:' url' attribute is not specified and no embedded datasource could be configured.
未能配置Datasource:“URL”属性未指定,也无法配置嵌入式数据源。

Reason: Failed to determine a suitable driver class
原因:未能确定合适的驱动程序类

 由上可知,当你项目需要自定义数据源的时候,或者不想系统自动注入数据源的时候,就把它排除掉。

在主启动类的注解中加上

exclude = DataSourceAutoConfiguration.class

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could_第2张图片

你可能感兴趣的:(Spring,bug,DataSource)