[
https://issues.apache.org/jira/browse/CONFIGURATION-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928195#action_12928195
]
Tamir Lahav commented on CONFIGURATION-426:
-------------------------------------------
we have a singleton class that extends CompositeConfiguration and uses
addConfiguration method to add configuration files:
public class CentralConfigurationListener implements ConfigurationListener,
ConfigurationErrorListener
{
// implementation of listener
}
public class CentralConfigurationValidator implements ErrorHandler
{
// implementation of validator
}
public class CentralConfiguration extends CompositeConfiguration
{
private static final CentralConfiguration sCentralConfiguration = new
CentralConfiguration();
private static final CentralConfigurationListener mListener = new
CentralConfigurationListener();
public boolean doConfigure(String pluginXmlFileName)
{
CentralConfigurationValidator validator = new
CentralConfigurationValidator();
FileChangedReloadingStrategy reloadStrategy = new
FileChangedReloadingStrategy();
XMLConfiguration pluginXmlFile = new XMLConfiguration();
pluginXmlFile.setFileName(pluginXmlFileName);
pluginXmlFile.setDocumentBuilder(validator.createDocumentBuilder());
pluginXmlFile.setValidating(true);
pluginXmlFile.load();
SubnodeConfiguration pluginXmlTierExtentionNode =
pluginXmlFile.configurationAt(cConfigurationXmlTagName,true);
// Adding pluginXmlFile to CentralConfiguration
sCentralConfiguration.addConfiguration(pluginXmlTierExtentionNode);
pluginXmlFile.setReloadingStrategy(reloadStrategy);
// Setting a configuration listener on the PluginXmlFile.
pluginXmlFile.addConfigurationListener(mListener);
pluginXmlFile.addErrorListener(mListener);
}
// other configuration methods
}
The exception is sporadic and we're using Commons Configuration 1.6
> ConcurrentModificationException is thrown from CompositeConfiguration.getList
> ------------------------------------------------------------------------------
>
> Key: CONFIGURATION-426
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-426
> Project: Commons Configuration
> Issue Type: Bug
> Components: Build
> Reporter: Tamir Lahav
>
> ConcurrentModificationException is thrown from
> CompositeConfiguration.getList although the object is used as "read only".
> Stack trace:
> java.util.ConcurrentModificationException
> at
> java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:632)
> at java.util.LinkedList$ListItr.next(LinkedList.java:567)
> at
> org.apache.commons.configuration.CompositeConfiguration.getList(CompositeConfiguration.java:294)
> at
> org.apache.commons.configuration.AbstractConfiguration.getList(AbstractConfiguration.java:1108)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.