Explain the function of static keyword and final keyword in Java in detail>>>
When the spring configuration loads the properties file, the
Could not resolve placeholder error
After careful searching, the reasons for the errors in file path and file class capacity are excluded. After searching for relevant information, “could not resolve placeholder” is likely to be the use of multiple propertyplaceholder configurators or multiple & lt; context:property-placeholder> Or multiple propertyplaceholder configurators and & lt; context:property-placeholder> Mixed use
If the configuration is as follows, the above error will be reported, whether in multiple configuration files or in different files
<context:property-placeholderlocation="WEB-INF/config/db/XX.properties"/><context:property-placeholderlocation="WEB-INF/config/dfs/XX.properties"/>
Solution:
in spring 3, you can solve the problem in the following ways: add the attribute ignore unresolved = “true”, and pay attention to add it
<context:property-placeholderlocation="xxx.properties"ignore-unresolvable="true"/><context:property-placeholderlocation="yyy.properties"ignore-unresolvable="true"/>
In spring 2.5, & lt; context:property-placeholder> If there is no ignore unresolved property, you can use propertyplaceholderconfigurer instead. Actually & lt; context:property-placeholder location= “xxx.properties”ignore-unresolvable=”true”/> It is equivalent to the following configuration
<beanid="XX"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><propertyname="location"value="xxx.properties"/><propertyname="ignoreUnresolvablePlaceholders"value="true"/></bean>
If the above error is reported in the system, it can be found as follows: search all the files containing property placeholders in the system to see if they contain the ignore unresolved property, and then search all the files containing property placeholder configurator in the system to see if they contain the ignore unresolved placeholders property
Today, the system reported the above error because it did not configure the ignoreunresolved placeholders property according to the propertyplaceholder configurator method, but instead, according to the context:property-placeholder Methods are configured to include the ignore unresolved attribute
in the final analysis, the specification is not in place, and the loading configuration file is not unified
Similar Posts:
- [Solved] Access denied for user ‘Administrator’@’localhost’ (using password: YES)
- [Solved] Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘custom.property.hello’ in value “${custom.property.hello}” config
- [Solved] Context initialization failed: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name ‘dataSource’ defined in URL…
- [Solved] Context initialization failed: org.springframework.beans.factory.BeanDefinitionStoreException
- [Solved] Spring introduces the properties variable Error: org.springframework.beans.TypeMismatchException…
- Phoenix Startup Error: Error: ERROR 726 (43M10): Inconsistent namespace mapping properties. Cannot initiate connection as SYSTEM:CATALOG is found but client does not have phoenix.schema.
- How hibernate 3 used in jbpm4.4 is compatible with spring 5.X and the exception caused by: java.lang.classnotfoundexception: org.hibernate.impl.sessionimpl
- Failed to bind properties under
- [Solved] Failed to bind properties under ” to com.zaxxer.hikari.Hikari DataSource Spring Boot
- How to Solve Hibernate error: No CurrentSessionContext configured!