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 @@
private static void checkFactoryName(String factoryName)