File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
appserver/microprofile/health/src/main/java/org/glassfish/microprofile/health Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,15 @@ public class HealthReporter {
4141 private final Map <String , List <HealthCheckInfo >> applicationHealthChecks = new ConcurrentHashMap <>();
4242
4343 private static HealthCheckResponse callHealthCheck (HealthCheck healthCheck ) {
44+ ClassLoader contextClassLoader = Thread .currentThread ().getContextClassLoader ();
4445 try {
46+ Thread .currentThread ().setContextClassLoader (healthCheck .getClass ().getClassLoader ());
4547 return healthCheck .call ();
4648 } catch (RuntimeException e ) {
4749 LOGGER .log (Level .SEVERE , "Health check failed" , e );
4850 return buildHealthCheckResponse (healthCheck .getClass ().getName (), e );
51+ } finally {
52+ Thread .currentThread ().setContextClassLoader (contextClassLoader );
4953 }
5054 }
5155
You can’t perform that action at this time.
0 commit comments