Allow restart to be enabled when CL not named AppClassLoader
Previously, the restart initializer that enables restart when -Dspring.devtools.restart.enabled=true is set had no effect when the ClassLoader's name did not contain AppClassLoader. This commit updates RestartApplicationListener to use the correct RestartInitializer when the system property has forcibly enabled restart. When restart is enabled a SilentExitException is thrown and it should be caught and handled by the SilentExitExceptionHandler. When the application is invoked via one of the loader's LauncherClasses reflection is used and this exception becomes wrapped in an InvocationTargetEception. Previously, this wrapping prevented SilentExitExceptionHandler from handling the exception. This commit updates the handler to look for an InvocationTargetException with a SilentExitException target in addition to continuing to look for a SilentExitException directly. Fixes gh-24797pull/24986/head
parent
26f143b8d3
commit
a95a7e3d40
Loading…
Reference in New Issue