码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2019-02-04 08:55:46      阅读:531      评论:0      收藏:0      [点我收藏+]

标签:数据   add   出现   target   内容   hsql   ring   win   reason   

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


***************************
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问题解决

标签:数据   add   出现   target   内容   hsql   ring   win   reason   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!