It seems that when deploying my Spring app to AppFog, that the environment variables are not being detected.
I have the environment variables declared in my console:
And I try to reference these from within my app code, like so:
<context:property-placeholder
location="classpath:server.common.properties,
classpath:server.${concorde-env}.properties"/>
However, this generates an error:
Caused by: java.io.FileNotFoundException: class path resource [server.${concorde-env}.properties] cannot be opened because it does not exist
This approach works fine in other (non AppFog) environments.
I logged out the properties by calling:
log.info("Properties: " + System.getProperties().toString());
And it doesn't show those properties as available.
However, if I do a af env <<MY_APP_NAME>>
, it shows the variables as present:
+--------------------------+------------------+
| Variable | Value |
+--------------------------+------------------+
| concorde-env | test |
| spring.profiles.active | runtime,test |
+--------------------------+------------------+
What am I missing to make these variables exposed to my app at runtime?