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

先看看启动完整的异常:

2021-03-07 19:11:22.118  INFO 3195 --- [  restartedMain] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
2021-03-07 19:11:22.153  INFO 3195 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-03-07 19:11:22.494  INFO 3195 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2021-03-07 19:11:22.513  INFO 3195 --- [  restartedMain] com.example.demo.DemoApplication         : Started DemoApplication in 0.612 seconds (JVM running for 1.065)

这里我是使用 idea 创建了一个Spring Boot demo 代码然后进行启动,但是启动就出现了这个问题,经过查询 问题就在上面的那个 没有默认配置的启动容器的意思?
由于我们没有加入 web 依赖所以启动的时候,加载不到启动的容器导致的错误,在pom.xml文件中加入 以下依赖就解决这个问题了:

   <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

再次启动,就启动成功了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值