spring cloud 学习过程中,其中把配置文件单独都放在一个config 项目中管理,配置文件目录放在resources/shard文件夹下,
被管理的项目启动后出行以下错误,原因是该项目resources 目录下的配置文件名为application.yml,应该改为bootstrap.yml就正常了,
该配置文件内容如下:
spring:
application:
name: logger-service
cloud:
config:
uri: http://localhost:8769 //config项目地址
fail-fast: true
profiles:
active: pro
bootstrap 文件启动优先于application,但是为什么以application命名就不行呢?
***************************
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).