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

FactoryFinder.releaseFactories() does not release application class loader. (PATCH available).

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.5, 1.2.0
    • 1.2.3
    • JSR-127
    • None

    Description

      FactoryFinder._registeredFactoryNames holds the Web application class loader as a key and thus prevents its collection when the application is undeployed.

      The following patch fixes the issue (made in 1.1.5 branch):

      Index: FactoryFinder.java
      ===================================================================
      — FactoryFinder.java (revision 608034)
      +++ FactoryFinder.java (working copy)
      @@ -40,7 +40,7 @@
      public static final String LIFECYCLE_FACTORY = "javax.faces.lifecycle.LifecycleFactory";
      public static final String RENDER_KIT_FACTORY = "javax.faces.render.RenderKitFactory";

      • private static Map _registeredFactoryNames = new HashMap();
        + private static Map _registeredFactoryNames = Collections.synchronizedMap(new HashMap());
        /**
      • Maps from classLoader to another map, the container (i.e. Tomcat) will create a class loader for
      • each web app that it controls (typically anyway) and that class loader is used as the key.
        @@ -49,7 +49,7 @@
      • that are created via getFactory. The instances will be of the class specified in the setFactory method
      • for the factory name, i.e. FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY, MyFactory.class).
        */
      • private static Map _factories = new HashMap();
        + private static Map _factories = Collections.synchronizedMap(new HashMap());

      private static final Set VALID_FACTORY_NAMES = new HashSet();
      private static final Map ABSTRACT_FACTORY_CLASSES = new HashMap();
      @@ -222,6 +222,7 @@

      { ClassLoader classLoader = getClassLoader(); _factories.remove(classLoader); + _registeredFactoryNames.remove(classLoader); }

      private static void checkFactoryName(String factoryName)

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            kostat Konstantin Triger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: