首页 > 编程语言 > 详细

java:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Failed to determine a suitable driver class

时间:2019-09-16 19:12:08      阅读:78      评论:0      收藏:0      [点我收藏+]

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

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

 

 

解决办法:

1 @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

   如果是多个:修改成@SpringBootApplication(exclude = {MongoAutoConfiguration.class, DataSourceAutoConfiguration.class})

2 上诉修改不生效:可能的原因是idea没有指定resource目录,导致启动时没读取到配置文件

   方法:右击resource文件夹 -> MarkDirectory as ->Sources Root

两种方法都试过了,第二个方法成功解决问题

  

java:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Failed to determine a suitable driver class

原文:https://www.cnblogs.com/singlelcx/p/11528570.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!