diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java index d2afc78f34..377c504fff 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java @@ -109,7 +109,8 @@ final class DispatcherServletHandlerMappings { Container child = context.findChild(name); if (child instanceof StandardWrapper) { try { - ((StandardWrapper) child).allocate(); + StandardWrapper wrapper = (StandardWrapper) child; + wrapper.deallocate(wrapper.allocate()); } catch (ServletException ex) { // Continue