spring boot 启动错误:Could not resolve placeholder
2023-09-14 09:11:44 时间
在启动整个spring boot项目时,出现错误:
Could not resolve placeholder
原因:没有指定好配置文件,因为src/main/resources下有多个配置文件,例如application-dev.properties, boss.properties等。
解决办法:
在application.properties中加入
spring.profiles.active=@env@
用来自动决定选择哪个配置文件。
项目中如果有dev、test、prod等多个配置文件的话,此处的@env@意思是可以让你选择依照哪个配置文件执行,
可以在IDEA的右侧的Maven Projects那里选择。
参考博客:https://blog.csdn.net/tonghuawanli/article/details/76595383
相关文章
- spring 2.5.6 错误:Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher
- Spring Boot 简介
- spring boot: spring Aware的目的是为了让Bean获得Spring容器的服务
- Spring中使用RedisTemplate操作Redis(spring-data-redis)
- 20-spring学习-Spring MVC基本操作
- Spring Boot 2.x :通过 spring-boot-starter-hbase 集成 HBase
- spring boot:shardingsphere+druid+mysql主从复制的读写分离(未分库分表)(spring boot 2.3.4)
- spring boot:使用async异步线程池发送注册邮件(spring boot 2.3.1)
- Spring_xml和注解混合方式开发
- [Spring Data JPA] Derived Query Methods
- 为什么Spring Boot推荐使用logback-spring.xml来替代logback.xml来配置logback日志的问题分析
- spring context架构--静态结构
- 【项目实战】Spring的@Import注解介绍
- 【Spring源码学习】spring IOC容器管理
- 学习Spring Boot:(十四)spring-shiro的密码加密
- 在Spring Boot + Mybatis 中,使用@Repository失效
- Kotlin instance variable is null when accessed by Spring proxied class
- 全网最完美地解决使用spring boot的@Value(“${xxx}“)注解时报出的错误:Could not resolve placeholder ‘xxx‘ in value “${xxx}“
- 009-Spring Boot 事件监听、监听器配置与方式、spring、Spring boot内置事件
- 使用Java Spring消费MySQL中的数据库存储过程
- spring-boot-starter-aop及其使用场景说明
- 【Spring源码学习】spring IOC容器管理
- 【java】Spring Boot --spring boot项目整合xxl-job
- Spring mysql 测试 Test 错误 : SpringJUnit4ClassRunner requires JUnit 4.12 or higher.