When starting the whole spring boot project, an error occurred:
could not resolve placeholder
Reason: the configuration file is not specified, because there are multiple configuration files under Src/main/resources, such as application- dev.properties , boss.properties And so on.
Solution:
method 1:
in application.properties Join in
spring.profiles.active= @env@
Used to automatically decide which profile to choose.
Method 2: (not a good method)
@Configuration
@EnableTransactionManagement
// Added by yourself, specifying the configuration file
@PropertySource(value = "classpath:application-dev.properties", ignoreResourceNotFound = true)
public class DruidDBConfig {
private static final Logger LOG = LoggerFactory.getLogger(DruidDBConfig.class);
@Value("${spring.datasource.url}")
private String dbUrl;
@Value("${spring.datasource.username}")
private String username;
。。。
}
Read More:
- New Spring boot startup error Failed to auto-configure a DataSource
- Dyf Spring boot startup error: NoSuchBeanDefinitionException
- [Solved] Could not resolve placeholder ‘XXX‘ in value “${XXX}“
- Spring-boot Use dubbo Error: ERROR 8404 o.s.boot.SpringApplication:Application run failed
- Two implementation methods of spring boot scan mapper interface class
- [Solved] spring boot security Start Error: ‘login.html?error‘ is not a valid redirect URL
- Spring Boot Druid Error: discard long time none received connection
- [neo4j] error report when visiting neo4j in spring boot project
- Spring boot uses configuration interface webmvcconfigurer to solve cross domain problems
- Causes of error in data transmission from spring boot to JSON
- [Solved] spring boot – JPA–H2 Error: H2 error: “Syntax error in SQL statement … expected identifier“
- Error running ‘PigSellCabinetApplication’: Command line is too long. Shorten command line for PigSellCabinetApplication or also for Spring Boot default configuration
- Wildfly (JBoss) startup error: ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“add”) failed
- Gateway Error: Cannot resolve org.springframework.cloud:spring-cloud-starter-gateway:unknown
- IDEA generates Spring Boot project error: error: read timed out
- Spring deployment error: Could not open ServletContext resource [/db.properties]
- [Solved] TensorFlow Error: you must feed a value for placeholder tensor
- Resolve Chromedriver’s original error: chrome not reachable
- [How to Fix] manual close is not allowed over a Spring managed SqlSession
- How to Fix Error when integrating spring cloud openfeign with spring cloud Alibaba