commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Pugh" <ep...@upstate.com>
Subject [configuration] RE: Commons/Config
Date Sat, 09 Oct 2004 11:17:44 GMT
MessageHi Mark..  You should send these to the mailing list, as you can then
have exposure to your question by lots of experts, and everybody can learn!
I am CC the list back.

First off, check out the RC2, that has many many fixes.  And 1.0 is expected
as soon as Henning has a chance to cut it.   For your problem, I think
everythign is relative to the working directory.  So, what you can do is set
up your file name as ../config/config_sub1.properties.

This will get around your initial issue.  I think the idea would always be
to run relative from your working directory unless you provided a full path.
Also, the latest version in CVS, which will be 1.0 Real Soon Now has a bunch
of much better path resolution code, applied in a more global manner.

Eric
  -----Original Message-----
  From: Mark.Woodman [mailto:Mark.Woodman@ISSinc.com]
  Sent: Saturday, October 09, 2004 2:19 AM
  To: epugh@upstate.com
  Subject: RE: Commons/Config


  Eric,

  I haven't seen any documentation that answers this question, so I was
hoping you might be able to help.

  Is there a way to have a configuration file specify that internal
resources should be found relative to the location of itself, rather than
relative to the location of the working directory?

  The build we have of the config package (August 11) seems to always use
the latter.   If the working directory doesn't contain the config file we're
using, we're up the proverbial creek.

  For example, lets say the working directory is:
      /app/bin

  And the config files live here:
      /app/config/config_main.xml
      /app/config/config_sub1.properties
      /app/config/config_sub2.properties

  And the contents of config_main.xml is:
      <configuration>
          <properties fileName="config_sub1.properties"/>
          <properties fileName="config_sub2.properties"/>
      </configuration>

  When I try to load config_main.xml (and the working directory is
/app/bin),
  the ConfigurationFactory tries to find /app/bin/config_sub1.properties
  and promptly throws an Exception.

  This seems to be a show-stopper for us.  Is this expected behavior, or has
it changed since August, or is there a way to tell the configuration to use
paths relative to the config file?

  Thanks for your help,

    Mark

  ______________________________
  Mark Woodman      719.234.0670
  Intelligent Software Solutions
  Email: Mark.Woodman@ISSinc.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message