Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4320

Startup ConcurrentModificationException in DefaultFacesConfigurationProvider

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.12, 2.3.6, 3.0.0-RC1
    • 2.2.13, 2.3.7, 3.0.0-RC1
    • None
    • None

    Description

      In an environment with multiple apps, it's possible to hit a ConcurrentModificationException during startup:

      Caused by: java.util.ConcurrentModificationException
      at java.util.HashMap$HashIterator.nextNode(HashMap.java:1456)
      at java.util.HashMap$KeyIterator.next(HashMap.java:1480)
      at org.apache.myfaces.config.DefaultFacesConfigurationProvider.getMetaInfServicesFacesConfig(DefaultFacesConfigurationProvider.java:218)

      This occurs because Set<String> FACTORY_NAMES is static, but the initialization block following it is not. So it's possible for that initialization block to get run - if a new DefaultFacesConfigurationProvider is initialized at the right time - while another instance is iterating over the set. The fix is to make the initialization block static, which we just need to backport from the master branch.

      Attachments

        Activity

          People

            wtlucy Bill Lucy
            wtlucy Bill Lucy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m