Spring Boot 启动:No active profile set, falling back to default profiles: default

时间:2024-04-21 11:28:46

启动 Spring Boot 失败,但是没有出现多余的异常信息:

Spring Boot 启动:No active profile set, falling back to default profiles: default

检查之后发现是依赖的问题(之前依赖的是 spring-boot-starter),修改即可:

Spring Boot 启动:No active profile set, falling back to default profiles: default

方法二:

pom.xml加上下面两个依赖

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

方法三:

Q:在springcloud多模块下创建一个新的server模块,但在好几个同事那里运行就没有报错,我这边就一直报这个错,经过一番挣扎后,最终在日志中发现了这个错“No active profile set, falling back to default profiles: default”

Spring Boot 启动:No active profile set, falling back to default profiles: default

但我这边有对应的配置文件:

Spring Boot 启动:No active profile set, falling back to default profiles: default

A:最后没办法只能是手动配置:

1.

.Spring Boot 启动:No active profile set, falling back to default profiles: default

2

Spring Boot 启动:No active profile set, falling back to default profiles: default

3

Spring Boot 启动:No active profile set, falling back to default profiles: default