一、在学习SpringBoot配置profile的时候,.yml文件内容明明跟老师敲的一模一样,但还是报org.springframework.boot.context.config.InvalidConfigDataPropertyExc
---server: port: 8081spring: profiles: dev---server: port: 8082spring: profiles: pro---server: port: 8083spring: profiles: test---spring: profiles: active: test
通过Debug运行提示: should be replaced with 'spring.config.activate.on-profile'(需要你改为现在的这种代码格式)
---server: port: 8081spring: config: activate: on-profile: dev---server: port: 8082spring: config: activate: on-profile: pro---server: port: 8083spring: config: activate: on-profile: test---spring: profiles: active: test
当按照老师讲的走时,遇到问题,需要及时通过Debug提示信息来找错误,不要死脑筋,一直检查代码错误。这次问题出在版本的原因。
我们需要养成会看代码提示来进行解决问题的习惯,脑子要灵活点。
来源地址:https://blog.csdn.net/weixin_54280370/article/details/129966091
--结束END--
本文标题: SpringBoot:解决Property ‘spring.profiles‘ imported from location ‘class path resource 问题
本文链接: https://www.lsjlt.com/news/398285.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-04-01
2024-04-03
2024-04-03
2024-01-21
2024-01-21
2024-01-21
2024-01-21
2023-12-23
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0