美文网首页
Failed to configure a DataSource

Failed to configure a DataSource

作者: 过客_hui | 来源:发表于2019-08-08 20:30 被阅读0次

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

***************************

 APPLICATION FAILEDTO 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'

Processfinished withexitcode 0

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

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

解决办法:

在启动类加如下内容:

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

相关文章

网友评论

      本文标题:Failed to configure a DataSource

      本文链接:https://www.haomeiwen.com/subject/rsmfjctx.html