You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Bill Lucy (Jira)" <de...@myfaces.apache.org> on 2020/02/26 17:12:00 UTC

[jira] [Created] (MYFACES-4320) Startup ConcurrentModificationException in DefaultFacesConfigurationProvider

Bill Lucy created MYFACES-4320:
----------------------------------

             Summary: Startup ConcurrentModificationException in DefaultFacesConfigurationProvider
                 Key: MYFACES-4320
                 URL: https://issues.apache.org/jira/browse/MYFACES-4320
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.3.6, 2.2.12
            Reporter: Bill Lucy
            Assignee: Bill Lucy


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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)