java.lang.IllegalArgumentException: Passed in key must select exactly one node:
-------------------------------------------------------------------------------

                 Key: CONFIGURATION-360
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-360
             Project: Commons Configuration
          Issue Type: Improvement
    Affects Versions: 1.5
            Reporter: chand
            Priority: Blocker


I am trying to pass a list of values as parameters(Key,Vaue) in a XML file. I 
am trying to pass the XML file to the XMLBeanDeclaration. It throws an error as 
noted below. Please note Key is the same but values are different in the list 
below. 

<?xml version="1.0" encoding="ISO-8859-1" ?>
<config>
  <gui>
    <windowManager config-class="examples.windows.DefaultWindowManager"
      closable="false" resizable="true" defaultWidth="400"
      defaultHeight="250">
      <styleDefinition config-class="examples.windows.WindowStyleDefinition"
        backColor="#ffffff" foreColor="0080ff" iconName="myicon" />
     <styleDefinition config-class="examples.windows.WindowStyleDefinition"
        backColor="#00000" foreColor="8888ff" iconName="youricon" />
    </windowManager>
  </gui>
</config>

I have a test configuration like this:
private TestConfiguration(String configFile) {
        try {
            URL configURL = getClass().getResource("windowconfig.xml");
            XMLConfiguration config = new XMLConfiguration(configURL);
            BeanDeclaration decl = new XMLBeanDeclaration(config, 
"gui.windowManager");
            WindowManager wm = (WindowManager) BeanHelper.createBean(decl);
        } catch (Exception exc) {
            throw new RuntimeException("Initialization failed", exc);
        }
    }


This is the exception I am getting from the above test:

java.lang.IllegalArgumentException: Passed in key must select exactly one node: 
styleDefinition 
                at 
org.apache.commons.configuration.HierarchicalConfiguration.configurationAt(HierarchicalConfiguration.java:581)
                at 
org.apache.commons.configuration.HierarchicalConfiguration.configurationAt(HierarchicalConfiguration.java:601)
                at 
org.apache.commons.configuration.beanutils.XMLBeanDeclaration.getNestedBeanDeclarations(XMLBeanDeclaration.java:313)

The HeirarchialConfiguration.configurationAt method only takes one value but 
not the list of values during XMLBeanDeclaration. 
Is there an alternative mechanism to pass a list of values? I would greatly 
appreciate any help with this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to