commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver.He...@t-online.de (Oliver Heger)
Subject Re: [Configuration] load config files from ddifferent jars
Date Mon, 09 Aug 2004 18:27:31 GMT
ConfigurationFactory should work with both relative and absolute file 
names (at least this is the theory ;-) You should also be able to pass 
in a complete URL.

Which operating system are you working on? If it is Unix/Linux, your 
configuration file shouldn't make problems (unless there is a bug in the 
methods for loading the configurations). Under Windows you will have to 
provide a filename like C:\mydir\myproperties.properties. You can also 
try to specify a file:/ URL pointing to your properties file.

Hope this helps!
Oliver

T E Schmitz wrote:

> Hello,
>
> I would like to set up a configuration factory specifying a properties 
> file which does not reside in the same jar as the composite 
> configuration .xml file.
>
> Example:
>
> <configuration>
>     <properties fileName="application.properties"/>
>     <properties fileName="/biz/prop.properties"/>
>     <hierarchicalDom4j fileName="objects/business-objects.xml"/>
> </configuration>
>
> It appears that the leading slash is stripped and an attempt is made 
> to read biz/prop.properties from the .jar file where above .xml config 
> resides.
>
> I notice there is a setBasePath() which would probably solve the 
> problem if all composite config files resides below the same basepath. 
> But in my case the various config files reside in different jar files.
>
> Is there a way of loading the various config files from different .jar 
> files?
>


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


Mime
View raw message