1. Problem description
Spring boot refers to the configuration in YML in entity class
@Value("${shiro.session.expireTime}")
private final int expireTime = 30;
As soon as the project is started, an error is reported, indicating that could not resolve placeholder in string value. This error is basically caused by “configuration file not found”( application.yml )】
2. Solutions
Check whether the target / classes directory exists application.yml configuration file
If it exists, add the primary key of propertysource to the configuration class, and judge whether it exists according to the error log application.yml Configuration file.
@Configuration
@PropertySource("classpath:application.yml")
public class ShiroConfig {
Read More:
- IllegalArgumentException: Could not resolve placeholder ‘‘ in value “${}“
- Springboot startup error could not resolve placeholder XXX
- Springboot error, unable to read configuration file: could not resolve placeholder ‘xxx’ in value “${XXX}
- BUG——Could not resolve placeholder ‘xxx‘ in value ‘${xxx}‘
- Spring boot problem 1: error reporting life processing instructions for building a spring boot project
- Spring boot can’t scan XML (invalid bound statement (not found))
- Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:repackage failed
- spring boot-beans in application context form a cycle
- Spring boot does not take effect when using @ size to verify a single set parameter of the control layer
- spring boot Whitelabel Error Page
- The spring boot project directly replaces the referenced jar package
- Spring boot thymeleaf crud implements simple functions of adding, deleting, modifying and querying
- Specify the configuration file when the spring boot command starts
- Lenovo-win7 system computer boot prompt error 1962: no operating
- Failure of spring boot configuration server port
- 13.2 spring boot start error: whitelabel error page
- The spring boot set appears in the stand-alone version of redis Servlet.service () for servlet [dispatcherServlet] in context with path [] thr
- AVD prompt Error:Could not Parse error string solution
- A repeated string is composed of two identical strings. For example, abcabc is a repeated string with length of 6, while abcba does not have a duplicate string. Given any string, please help Xiaoqiang find the longest repeated substring.
- Cannot resolve plugin org.springframework .boot:xxx