Except for the Properites file path error and spelling errors, it is likely that Could not resolve placeholder is using more than one propertyplaceholderconfigurer or more <context: The reason for property-placeholder>.
For example, I have a dao.xml read dbconnect.properties, and a dfs.xml read dfsmanager.properties, and then Web. XML for unified load two XML files < Context-param> <param-name>contextConfigLocation</param-name> <param-value> Web-inf/config/spring/dao.xml, Web-inf/config/spring/dfs.xml </param-value> ; </context-param>
If you have XML code in these two XML files <!--dao.xml---<context:property-placeholder location= "web-inf/config/db/ Dbconnect.properties "/> <!--dfs.xml-<context:property-placeholder location=" WEB-INF/CONFIG/DFS/DF Smanager.properties "/>
Then, must be out "Could not resolve placeholder".
Be sure to remember to write the XML code directly, whether in a spring file or in the case of multiple spring files being unified load <context:property-placeholder location= ""/> < Context:property-placeholder location= ""/>
is not allowed.
Solution:
(1) In Spring 3.0, you can write: XML code <context:property-placeholder location= "Xxx.properties" ignore-unresolvable= "true"/&G T <context:property-placeholder location= "Yyy.properties" ignore-unresolvable= "true"/>
Note that all two must be added ignore-unresolvable= "true", one plus the other does not add.
(2),<context:property-placeholder> has no ignore-unresolvable attribute in Spring 2.5, you can use Propertyplaceholderconfigurer instead. In fact <context:property-placeholder location= "Xxx.properties" ignore-unresolvable= "true"/> with the following configuration is equivalent Java code < Bean id= "Casual" class= "Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" > <property name= "Location" value= "Xxx.properties"/> <property name= "Ignoreunresolvableplaceholders" value= "true"/> < ;/bean>
Because of this, writing multiple propertyplaceholderconfigurer does not add ignoreunresolvableplaceholders attributes will also be out "Could not resolve placeholder".
Although the two are equivalent, but it is estimated that people still like to write <context:property-placeholder> more, after all, simple. So if it's Spring 3.0, it's easy to use the solution (1), and if it's spring 2.5, it takes a little effort to rewrite it into Propertyplaceholderconfigurer.
P.S. In fact, the name of this property I have never understood ... ignoreunresolvableplaceholders, ignore unresolved placeholders ... What is the placeholder is not resolvable.