preface
When configuring multiple environment files for springboot, you need to configure multiple YML files. The configuration before version 2.4 is as follows:
spring:
profiles:
active: dev
But if SpringBoot’s version 2.4 later, it’s a reward.
org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property ‘spring.profiles.active[0]’ imported from location ‘class path resource [application-work.yml]’ is invalid in a profile specific resource [origin: class path resource [application-work.yml] - 9:7]
Solution:
General layout changes as follows:
spring:
config:
activate:
on-profile:
- dev
Of course, it can also be solved by returning the spring boot version to before 2.4
Read More:
- How to Solve Springboot YML configurate logging.level error
- Springboot2.6.X configurate swagger error [How to Solve]
- How to Solve Springboot use thymeleaf template error
- How to Solve error creating bean with name when springboot starts
- How to Solve Springboot Upload Files Error: The field XXX exceeds its maximum permitted size of 1048576 bytes
- How to Solve Java Runtime (class file version 53.0)ERROR
- How to Solve The classpathresource reads the resource file Error
- Springboot Project: How to Introduces Local Jar Package
- How to Solve SSM JSON Chinese Messy Code Issue
- The @value annotation of springboot adds the default value to solve the startup error caused by the non-existent key
- How to Solve Error: Maven ‘parent.relativePath‘ of POM…
- How to Solve Swagger error: IllegalStateException
- Springboot Files Upload Limit Error: The field file exceeds its maximum permitted size of 1048576 bytes
- Springboot Project Error: Failed to execute goal org.apache.maven.plugins
- How to Solve Spring integrate Seata startup error
- How to Solve Mybatis error: invalid bound statement (not found)
- How to Solve shiro Set sessionIdUrlRewritingEnabled Error (jessionid Removed)
- How to Solve JDBC connection error in spring MVC integration
- How to Solve Error-SpringCloud-Feign and Sentinel integrate error
- How to Solve Nosuchmethoderror Error