Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 从属jar中的spring appContext.xml无法加载属性文件。_Java_Spring_Properties_Dependencies_Classpath - Fatal编程技术网

Java 从属jar中的spring appContext.xml无法加载属性文件。

Java 从属jar中的spring appContext.xml无法加载属性文件。,java,spring,properties,dependencies,classpath,Java,Spring,Properties,Dependencies,Classpath,我有两个基于spring的jar文件——parent.jar和child.jar parent.jar有一个parent_applicationContext.xml和一个属性文件,其加载方式如下 <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list>

我有两个基于spring的jar文件——parent.jar和child.jar

parent.jar有一个parent_applicationContext.xml和一个属性文件,其加载方式如下

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="locations">
    <list>
      <value>classpath:app.properties</value>
    </list>
  </property>
  <property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>

<bean id="appBean" class="com.foo.App" >
    <property name="appName" value="${app.name}" />
</bean>

有什么线索吗

我通过在child.jar中再次加载属性来解决它!applicationContext.xml类似这样

<context:property-placeholder location="monitordb.properties" />   

<context:property-placeholder location="monitordb.properties" />