commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trenton D. Adams" <tre...@athabascau.ca>
Subject Commons Configuration XML problem
Date Tue, 17 Oct 2006 23:12:54 GMT
Hi guys,

I'm playing with commons-configuration.  It doesn't appear to be working
correctly.  it is loading my config file, as the getRootElementName()
does return the appropriate string.

The menus.menu.display log entries return null.  I've attached a sample
config.  Any help to shed light on this issue would be much appreciated.

Thanks.


      try
      {
          XMLConfiguration config = new XMLConfiguration(
              "/path/to/menu.xml");
          logger.info("File: " + config.getFileName());
          logger.info("root element: " + config.getRootElementName());
          logger.info("display:" +
config.getString("menus.menu(0).display"));
          logger.info("display:" + config.getString("menus.menu.display"));
          Collection collection =
(Collection)config.getProperty("menus.menu.display");
          if (collection != null)
          {
              logger.info("IT'S A COLLECTIONS");
              Iterator menus = collection.iterator();
              while (menus.hasNext())
              {
                  logger.info("menus." + menus.next());
              }
          }
      }
      catch(ConfigurationException cex)
      {
	// this reports NOTHING.  There appears to be no errors.
          logger.error("Configuration error: " + cex);
      }

__ 
    This communication is intended for the use of the recipient to whom it
    is addressed, and may contain confidential, personal, and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take
    action relying on it. Any communications received in error, or
    subsequent reply, should be deleted or destroyed.
---

Mime
View raw message