Try Collection collection = (Collection)config.getProperty("menu.display");Drop "menus" prefix. Cheers, Borut On 18.10.2006 1:12, Trenton D. Adams wrote: 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. --- |
- Commons Configuration XML problem Trenton D. Adams
- Re: Commons Configuration XML problem Borut Bolčina
- Re: Commons Configuration XML problem Trenton D. Adams