Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-278

ConcurrentModificationException in PropertiesConfigurationLayout

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      Description

      PropertiesConfigurationLayout is not thread safe, if a configuration event is received when the configuration is being saved, a ConcurrentModificationException is thrown :

      java.util.ConcurrentModificationException
      at org.apache.commons.collections.map.AbstractLinkedMap$LinkIterator.nextEntry(AbstractLinkedMap.java:555)
      at org.apache.commons.collections.map.AbstractLinkedMap$KeySetIterator.next(AbstractLinkedMap.java:455)
      at org.apache.commons.configuration.PropertiesConfigurationLayout.save(PropertiesConfigurationLayout.java:455)
      at org.apache.commons.configuration.PropertiesConfiguration.save(PropertiesConfiguration.java:410)
      at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:517)
      at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:484)
      at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:451)
      at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:425)
      at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:373)
      at org.apache.commons.configuration.AbstractFileConfiguration.possiblySave(AbstractFileConfiguration.java:725)
      at org.apache.commons.configuration.AbstractFileConfiguration.clearProperty(AbstractFileConfiguration.java:764)
      at org.apache.commons.configuration.DataConfiguration.clearProperty(DataConfiguration.java:109)
      at org.apache.commons.configuration.AbstractConfiguration.setProperty(AbstractConfiguration.java:483)

      This happens easily in a multi threaded application using a central configuration with auto saved enabled.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ebourg Emmanuel Bourg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: