问题描述
path.properties文件db.properties.path=file:config/db.propertiesftp.properties.path=file:config/FtpClientConfig.propertiesinterface.properties.path=file:config/interfaceRMI.propertiesaddress.properties.path=file:config/address.propertiesspring配置文件:<beanid="pathonfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><propertyname="order"value="1"/><propertyname="ignoreUnresolvablePlaceholders"value="true"/><propertyname="locations"><list><value>file:config/path.properties</value></list></property></bean><beanid="propertyConfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><propertyname="order"value="2"/><propertyname="ignoreUnresolvablePlaceholders"value="true"/><propertyname="locations"><list><value>${db.properties.path}</value><value>${interface.properties.path}</value></list></property></bean>但是运行错误:Exceptioninthread"main"org.springframework.beans.factory.BeanInitializationException:Couldnotloadproperties;nestedexceptionisjava.io.FileNotFoundException:classpathresource[${db.properties.path}]cannotbeopenedbecauseitdoesnotexistatorg.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:87)为啥第二个bean无法使用第一bean的资源属性值。盼高人解答。
解决方案
本帖最后由 jackychen_king 于 2014-10-15 16:56:10 编辑
解决方案二:
顶一下,问题着急啊,都好几天了。没有解决办法