Xml 找不到元素[属性占位符]的BeanDefinitionDecorator
我试图在Spring独立项目中加载属性文件,我面临着很多困难 我有如下spring.xml文件,并试图加载config.properties文件,该文件包含DB Url、用户id、密码等 注意:com.ioc.collections.PropertyClassDepInj.resources是myspring.xml和config.properties所在的包 Spring.xmlXml 找不到元素[属性占位符]的BeanDefinitionDecorator,xml,spring,Xml,Spring,我试图在Spring独立项目中加载属性文件,我面临着很多困难 我有如下spring.xml文件,并试图加载config.properties文件,该文件包含DB Url、用户id、密码等 注意:com.ioc.collections.PropertyClassDepInj.resources是myspring.xml和config.properties所在的包 Spring.xml <bean id="pojoClassA" class="com.ioc.collections.Prope
<bean id="pojoClassA" class="com.ioc.collections.PropertyClassDepInj.PojoClassA">
<!-- java.util.Properties -->
<property name="propObj">
<props>
<prop key="admin">admin@nospam.com</prop>
<prop key="support">support@nospam.com</prop>
</props>
</property>
<context:property-placeholder location="classpath:/config.properties"
ignore-unresolvable="true" />
<!--
<util:properties id="pp" location="classpath:com.ioc.collections.PropertyClassDepInj.resources.config.properties">
</util:properties>
-->
</bean>
admin@nospam.com
support@nospam.com
当我运行main类时,我面临以下异常
线程“main”org.springframework.beans.factory.parsing异常:配置问题:找不到元素[属性占位符]的BeanDefinitionDecorator
我在谷歌上搜索了许多与此相关的帖子,但仍然不清楚。我想了解此异常的根本原因以及如何修复此错误
此外,还需要知道如何使用
如何在eclipse中为包中的特定项目设置类路径
如何通过spring.xml文件将属性值(如DB Url、DB Password等)从属性注入POJO类?完整的示例代码将非常棒 我得到了答案,它是固定的。我想和大家分享一下。事实上,谢谢。这个对我有帮助。