No. You would have to look at how HierarchicalConfiguration differs and create a patch. IIRC the problems were confined to that one class.

Ralph

On May 8, 2009, at 12:15 AM, Jonathan Su wrote:

Hi Ralph,

Thanks for the fast response! I just checked out the trunk and built the jar, and it is indeed now saving the file successfully. Do you know of any
possible workarounds with version 1.6 release?

Thanks again,
Jonathan

On Thu, May 7, 2009 at 7:14 PM, Ralph Goers <[email protected] >wrote:

Actually, I take it back. I think I already fixed this. Can you check out
trunk and see if you still have the same problem?

Ralph

On May 7, 2009, at 5:00 PM, Jonathan Su wrote:

Hi,

I am using the CombinedConfiguration class to combine two
XMLConfigurations
and trying to save the result as xml. My code is as follows:

CombinedConfiguration cc = new CombinedConfiguration(new
OverrideCombiner());
             cc.addConfiguration(firstXMLConfig);
             cc.addConfiguration(secondXMLConfig);
             combinedConfig = new XMLConfiguration(cc);
             combinedConfig.save("path/to/file.xml");

When I try to do the save operation however, I am getting the following
exception:

Caused by: java.lang.ClassCastException:
org.apache.commons.configuration.tree.ViewNode cannot be cast to
org.apache.commons.configuration.HierarchicalConfiguration$Node
 at

org.apache.commons.configuration.HierarchicalConfiguration $BuilderVisitor.visitBeforeChildren(HierarchicalConfiguration.java: 1624)
 at

org.apache.commons.configuration.HierarchicalConfiguration $Node.visit(HierarchicalConfiguration.java:1329)
 at

org.apache.commons.configuration.XMLConfiguration $XMLBuilderVisitor.processDocument(XMLConfiguration.java:1321)
 at

org .apache .commons .configuration .XMLConfiguration.createDocument(XMLConfiguration.java:759)
 at

org .apache .commons.configuration.XMLConfiguration.save(XMLConfiguration.java: 878)
 at

org .apache.commons.configuration.AbstractHierarchicalFileConfiguration $ FileConfigurationDelegate .save(AbstractHierarchicalFileConfiguration.java:454)
 at

org .apache .commons .configuration .AbstractFileConfiguration.save(AbstractFileConfiguration.java:546)
 at

org .apache .commons .configuration .AbstractFileConfiguration.save(AbstractFileConfiguration.java:513)
 at

org .apache .commons .configuration .AbstractFileConfiguration.save(AbstractFileConfiguration.java:491)
 at

org .apache .commons .configuration .AbstractFileConfiguration.save(AbstractFileConfiguration.java:403)
 ... 26 more

It looks like ViewNode is created when firstXMLConfig and secondXMLConfig have a node with the same key in the combine process. Is there a way to convert all ViewNodes into HierarchicalConfiguration.Node? Or am I using
this incorrectly?

Thanks,
Jonathan



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to