Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta4
    • Fix Version/s: 2.0-beta5
    • Component/s: Core
    • Labels:

      Description

      We randomly get the following:

      java.util.ConcurrentModificationException
      at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:377)
      at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:361)
      at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:266)
      at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:134)
      at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:75)
      at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:30)
      at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:165)
      at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:174)
      at …

      factories is defined as:

      private static List<ConfigurationFactory> factories = new ArrayList<ConfigurationFactory>();

      The simple fix is to use a java.util.concurrent.CopyOnWriteArrayList:

      private static final List<ConfigurationFactory> factories = new CopyOnWriteArrayList<ConfigurationFactory>();

      https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java

        Activity

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Jed Wesley-Smith
          • Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development