perfsonar-dev - Re: [pS-dev] Field order in properties files
Subject: perfsonar development work
List archive
- From: Gijs Molenaar <>
- To: Gijs Molenaar <>
- Cc: Roman Łapacz <>, "" <>
- Subject: Re: [pS-dev] Field order in properties files
- Date: Thu, 29 Mar 2007 16:25:51 +0200
Nobody has an answer to this question?
Gijs Molenaar wrote:
Roman Łapacz wrote:
Gijs Molenaar napisał(a):
Hi,
During development of our service, we discovered a problem with ant. When ant changes some variables in the components.properties file, the order of the lines are changed. Given the fact that the components (config, logger, etc.) are loaded in the exact order in which they appear in the components.properties file, this causes a problem.
For example in our case the logger is loaded before config now, so the logger misses some config values.
Does anyone know how to solve this problem? Are we doing something wrong?
Take RRD MA as an example:
you can find copy-components-properties target in rrdma/rrdma-configure-targets.xml file. This target changes the name of conf/components.properties.rrdma file to conf/components.properties. In the former you can see the list of components in order which is needed and renaming does not change it. copy-components-properties target is executed in configure target.
I'm not really sure if you understand my question. You are right that copying a file doesn't change the order. The problem occurs when the ant script is trying to enable ls registration functionality:
<replace file="conf/components.properties" token="#registrator=org.perfsonar.service.measurementArchive.register.LSRegistrationComponent" value="registrator=org.perfsonar.service.measurementArchive.register.LSRegistrationComponent"/>
When the ant script regenerates the components.properties file, the order is pretty much different:
before:
------
# File contains components to load
# Config and logger MUST be load as first!
#Configuration component - must be the first one!
config=org.perfsonar.commons.auxiliary.components.configuration.properties.PropertiesConfigurationComponent
#Logger component - must be the second one!
logger=org.perfsonar.commons.auxiliary.components.logger.log4j.Log4jLoggerComponent
# Simple scheduler
#mp_scheduler=org.perfsonar.commons.auxiliary.components.simplescheduler.Scheduler
# Registration in LS
#registrator=org.perfsonar.service.measurementPoint.register.LSRegistrationComponent
#Service specific components
#...
------
after:
------
#This file was created by the Ant configuration script.
#Fri Mar 16 15:14:35 CET 2007
mp_scheduler=org.perfsonar.commons.auxiliary.components.simplescheduler.Scheduler
logger=org.perfsonar.commons.auxiliary.components.logger.log4j.Log4jLoggerComponent
config=org.perfsonar.commons.auxiliary.components.configuration.properties.PropertiesConfigurationComponent
registrator=org.perfsonar.service.measurementPoint.register.LSRegistrationComponent
------
This is the same for service.properties, which can be quite frustrating.
in short the question is; is it possible to tell ant not to randomly shuffle the order of the lines of the files it processes? When I look at the ant code of other MA/MP's I can't find a solution.
thanks,
- gijs
- Field order in properties files, Gijs Molenaar, 03/12/2007
- Re: [pS-dev] Field order in properties files, Roman Łapacz, 03/12/2007
- Re: [pS-dev] Field order in properties files, Gijs Molenaar, 03/16/2007
- Re: [pS-dev] Field order in properties files, Gijs Molenaar, 03/29/2007
- Re: [pS-dev] Field order in properties files, Roman Lapacz, 03/30/2007
- Re: [pS-dev] Field order in properties files, Gijs Molenaar, 03/16/2007
- Re: [pS-dev] Field order in properties files, Roman Łapacz, 03/12/2007
Archive powered by MHonArc 2.6.16.