You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Tamir Lahav (JIRA)" <ji...@apache.org> on 2010/11/01 13:59:26 UTC

[jira] Created: (CONFIGURATION-426) ConcurrentModificationException is thrown from CompositeConfiguration.getList

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.


[jira] Closed: (CONFIGURATION-426) ConcurrentModificationException is thrown from CompositeConfiguration.getList

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger closed CONFIGURATION-426.
--------------------------------------

       Resolution: Not A Problem
    Fix Version/s: 1.7

Works as expected, so closing this issue.

> 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
>             Fix For: 1.7
>
>
> 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.


[jira] Commented: (CONFIGURATION-426) ConcurrentModificationException is thrown from CompositeConfiguration.getList

Posted by "Tamir Lahav (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929336#action_12929336 ] 

Tamir Lahav commented on CONFIGURATION-426:
-------------------------------------------

Ok, makes sense :)

thanks for the quick reply


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


[jira] Commented: (CONFIGURATION-426) ConcurrentModificationException is thrown from CompositeConfiguration.getList

Posted by "Tamir Lahav (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (CONFIGURATION-426) ConcurrentModificationException is thrown from CompositeConfiguration.getList

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926997#action_12926997 ] 

Oliver Heger commented on CONFIGURATION-426:
--------------------------------------------

Could you please provide some more information:
* A short code fragment how the configuration object is created and accessed
* Does the exception happen all the time or occasionally?
* Which version of Commons Configuration do you use?

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


[jira] Commented: (CONFIGURATION-426) ConcurrentModificationException is thrown from CompositeConfiguration.getList

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928341#action_12928341 ] 

Oliver Heger commented on CONFIGURATION-426:
--------------------------------------------

CompositeConfiguration is not thread-safe. If you add a new child configuration in one thread while accessing the configuration in another thread, such ConcurrentModificationExceptions can occur. Admitted, there is no explicit warning in the Javadocs, but the user's guide has a general note about thread-safety of configuration implementations:

http://commons.apache.org/configuration/userguide/overview.html#Threading_issues

When using an instance as a singleton you have to provide proper synchronization yourself.

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