Skip to content

Commit

Permalink
Merge pull request wildfly#18063 from bstansberry/WFLY-19523
Browse files Browse the repository at this point in the history
[WFLY-19523] Always clear the deployment CL from WildFlyConfiguration…
  • Loading branch information
bstansberry authored Jul 18, 2024
2 parents 6c4a221 + 703398b commit 900651d
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,19 +393,21 @@ public void undeploy(DeploymentUnit context) {
//see https://issues.jboss.org/browse/WFLY-7037
//see https://github.com/FasterXML/jackson-databind/issues/1363
//we use reflection to avoid a non optional dependency on jackson
Module module = null;
try {
Module module = context.getAttachment(Attachments.MODULE);
module = context.getAttachment(Attachments.MODULE);
Class<?> typeFactoryClass = module.getClassLoader().loadClass("com.fasterxml.jackson.databind.type.TypeFactory");
Method defaultInstanceMethod = typeFactoryClass.getMethod("defaultInstance");
Object typeFactory = defaultInstanceMethod.invoke(null);
Method clearCache = typeFactoryClass.getDeclaredMethod("clearCache");
clearCache.invoke(typeFactory);
} catch (Exception e) {
JAXRS_LOGGER.debugf("Failed to clear class utils LRU map");
} finally {
// Remove the deployment from the registered configuration factory
if (JaxrsDeploymentMarker.isJaxrsDeployment(context)) {
if (module != null && JaxrsDeploymentMarker.isJaxrsDeployment(context)) {
WildFlyConfigurationFactory.getInstance().unregister(module.getClassLoader());
}
} catch (Exception e) {
JAXRS_LOGGER.debugf("Failed to clear class utils LRU map");
}
}

Expand Down

0 comments on commit 900651d

Please sign in to comment.