commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [Configuration] XMLConfiguration Duplicate Entries
Date Thu, 18 Jan 2007 20:26:18 GMT
Brian O'Connell wrote:
> I searched the archives (the best I could) but was unable to locate a
> solution to this problem.
> 
> I am using commons configuration 1.3
> 
> I am seeing duplicate entries using the getStringArray method with an
> XMLConfiguration.
> 
> Here is an example configuration file:
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <CollectiveVerificationTool>
>   <Topic>test</Topic>
> 
>   <Publication>
>      <Username>user</Username>
>      <Password>usertest</Password>
>   </Publication>
> 
>   <Hosts>
>      <Subscribers>node1</Subscribers>
>      <Publishers>node3</Publishers>
>   </Hosts>
> 
> 
> </CollectiveVerificationTool>
> 
> 
> Here is a code snippet that experiences the problem.
> 
> 
> String single = configuration.getString( key );
> 
> System.out.println(single);
> 
> String value[] = configuration.getStringArray( key );
> 
> System.out.println("Size of Array: " + value.length);
> 
> System.out.println(Arrays.asList(value));

Sorry, but from this snippet I cannot track down the problem. Which 
value has the key variable? How did you load the configuration?

Oliver


> 
> 
> Here is the output of that snippet:
> 
> node1
> Size of Array: 2
> [node1, node1]
> 
> 
> I would expect the size of the array to be 1 and the only item to be a
> single entry of node1.
> 
> Any pointers are appreciated.
> 
> Thanks!
> 


---------------------------------------------------------------------
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