Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.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 未从服务器环境中选取属性值的spring配置文件存在问题?_Java_Spring_Spring Mvc_Spring Profiles - Fatal编程技术网

Java 未从服务器环境中选取属性值的spring配置文件存在问题?

Java 未从服务器环境中选取属性值的spring配置文件存在问题?,java,spring,spring-mvc,spring-profiles,Java,Spring,Spring Mvc,Spring Profiles,我已经将spring.profiles.active环境变量配置到WebSphereServer中,并将变量值配置到spring配置文件中。 我的Config.xml类似于 <bean id="propertiesUtil" class="common.PropertiesUtil"> <property name="locations"> <list> <value>classpath:common

我已经将spring.profiles.active环境变量配置到WebSphereServer中,并将变量值配置到spring配置文件中。 我的Config.xml类似于

<bean id="propertiesUtil" class="common.PropertiesUtil">
    <property name="locations">
        <list>
            <value>classpath:common.properties</value>
            <value>classpath:${spring.profiles.active}/env_${spring.profiles.active}_config.properties</value>
        </list>
    </property>
如果我错过了什么,请告诉我?

谢谢,
它正在工作,我已经从WAS环境中获取了spring.profiles.active变量的值并存储到上下文范围中。

您确实有一个
否,我只在beanThen中配置了占位符无法工作。您需要添加占位符配置才能替换占位符。如何以及在何处添加占位符您可以给出示例吗?请阅读我的初始评论。。。
Caused by: java.io.FileNotFoundException: class path resource
[${spring.profiles.active}/env_${spring.profiles.active}_config.properties] 
cannot be opened because it does not exist