No active profile set, falling back to default profiles: default

在使用spring cloud 微服务平台的过程中,遇到服务获取不到配置中心的配置文件,启动报如下错误:
No active profile set, falling back to default profiles: default,经逐步排查发现问题
1.bootstrap.properties 配置文件内容核查
spring.cloud.config.uri=http://127.0.0.1:5571/
spring.cloud.config.label=profiles
spring.application.name=resource-local-ts
spring.cloud.config.profile=devs
未发现问题
2.spring-config-server 服务核查
resource-local-ts-devs.yml
未发现问题
3.spring-config-server 服务正常启动,可手动获取到配置文件
http://127.0.0.1:5571/resource-local-ts/devs

经过上面的排查,想到可能是pom.xml文件中未引依赖jar包
<!-- 配置中心 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
加上依赖,重新启动,问题解决。


"No active profile set, falling back to default profiles: default"这个错误提示意味着在项目启动时没有设置激活的配置文件,导致使用了默认的配置。造成这个问题的原因有多种可能性。 一种可能是由于resources目录或配置文件没有被正确识别。另一种可能是编译后的target文件夹中缺少配置文件。 另外,根据的提示,还可能存在其他原因导致该错误。 解决这个问题的方法包括查看是否存在pom文件中的"<packaging>pom</packaging>"配置,如果存在,将其删除后重新编译即可。此外,可以查看Maven的打包方式以了解更具体的原因。 另外,根据的提示,可能还存在matplotlib的字体管理问题。可以尝试解决该问题,以防止出现其他相关错误。 综上所述,解决"No active profile set, falling back to default profiles: default"的方法包括检查资源文件和配置文件是否正确识别,删除不必要的配置项,并查看相关的打包方式。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [解决 :No active profile set, falling back to default profiles: default 问题](https://blog.csdn.net/weixin_42140801/article/details/127267102)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [1238: UserWarning: findfont: Font family [‘sans-serif’] not found. Falling back to DejaVu Sans.](https://download.csdn.net/download/weixin_38560768/13738690)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值