美文网首页
Failed to configure a DataSource

Failed to configure a DataSource

作者: 见字如晤一 | 来源:发表于2019-04-03 16:06 被阅读0次

情景再现

第一个springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde

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

解决方法:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class DemoApplication {
public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
  }
}

相关文章

网友评论

      本文标题:Failed to configure a DataSource

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