2014-09-02 20 views
0

我已将spring.profiles.active环境变量配置到websphere服务器,并将变量值用于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是这样的:

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 

请让我知道如果我错过了什么?

+0

您确实配置了 2014-09-02 10:12:13

+0

不,我只配置了豆 – lilhore 2014-09-02 10:16:16

+0

然后占位符将无法工作。您需要添加占位符configurere才能替换占位符。 – 2014-09-02 10:18:54

回答

0

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