-
Bug
-
Resolution: Done
-
Critical
-
22.0.0.Final
-
None
When excluding the jackson-dependencies from a .war file hot deployment will fail after a few times and Wildfly will hang with an OutOfMemoryError: Metaspace
It seems that old ModuleClassLoaders are not garbage-collected because org.jboss.as.jaxrs.deployment.WildFlyConfigurationFactory still holds a reference to the module classloader.
module unloading fails at this point in org.jboss.as.jaxrs.deployment.JaxrsIntegrationProcessor#undeploy:
Class<?> typeFactoryClass = module.getClassLoader().loadClass("com.fasterxml.jackson.databind.type.TypeFactory"); // <-- this throws a ClassNotFoundException ... if (JaxrsDeploymentMarker.isJaxrsDeployment(context)) { WildFlyConfigurationFactory.getInstance().unregister(module.getClassLoader()); // <-- this never gets called }
suggested fix would be to move the unregister(..) part out of the try/catch block.