在中将
Exception in thread "main" : Invalid bean definition with name 'dsd' defined in class path resource []: Could not resolve placeholder '' in string value "${}"; nested exception is : Could not resolve placeholder '' in string value "${}"
at (:223)at (:222)
at (:86)
at (:284)
at (:166)
at (:681)
at (:523)
at .<init>(:139)
at .<init>(:93)
at (:18)
at .invoke0(Native Method)
at (:62)
at (:43)
at (:498)
at (:144)
Caused by: : Could not resolve placeholder '' in string value "${}"
at (:174)
at (:126)
at $(:258)
at (:282)
at (:204)
at (:141)
at (:82)
at (:220)
... 14 more
在spring中如果出现类似的错误,
那么出现异常信息的可能性有三种
(1)location中的属性文件配置错误
(2)location中定义的配置文件里面没有对应的placeholder值
(3)第三种就比较麻烦点,可能是Spring容器的配置问题
Spring容器采用反射扫描的发现机制,在探测到Spring容器中有一个
而这个基于命名空间的配置,其实内部就是创建一个PropertyPlaceholderConfi
<bean class=""> <property name="locations"> <list> <value>classpath:</value> <!--<value>classpath:</value>--> </list> </property> </bean>总结:这个类在一个项目的中配置一次1就够了。