commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: Variable Interpolation not working for me.
Date Thu, 13 Sep 2007 20:10:03 GMT
Anthony_Crouch@Dell.com wrote:
> I am currently trying to test out the variable Interpolation  and cannot
> get it to work properly. I am not sure if it is bug or just misuse on my
> part as I am new to the commons package. Any help would be much
> appreciated. 
> 
> I load up my configuation files this way and all else seems to work. 
> 
> 			config = new
> PropertiesConfiguration(pathfilename);
> 			FileChangedReloadingStrategy strat = new
> FileChangedReloadingStrategy();
> 			strat.setRefreshDelay(30000);
> 			config.setReloadingStrategy(strat);
> 
> My property exists in my main propery file that I use to load other
> property files. 
> 
> include = General.properties
> include = DragonfxBeanPoolFactory.properties
> include = MsgEventMapping.properties
> include = LSPMsgTypeMappings.properties
> include = ReportConfig.properties
> include = SendingMessage.properties
> LOGFILE_PROPERTIES={sys:app_env}_{sys:app_vm}_log4j.xml
> 
> My system properties are set using the vm parameter.  -Dapp_env=dev
> -Dapp_vm=web 
> 
> They are available when I use system.getProperty to access them. I am
> using 1.4 version of the commons jar. 
> 
> When I get the property it returns the string with the brackets etc like
> it cannot find the system property. 
> 
> Thanks ahead of time for any help you may provide.
> 
Don't know whether this is really the problem, but you are missing a 
'$'. Variables in a configuration file have the form ${...}, so the line 
in your properties file should run:

LOGFILE_PROPERTIES=${sys:app_env}_${sys:app_vm}_log4j.xml

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message