Avoid using LiveBeansView in GraalVM native images

Closes gh-25344
This commit is contained in:
Sébastien Deleuze 2020-06-30 11:50:26 +02:00
parent e251075d6c
commit 9d37794ebc
1 changed files with 6 additions and 2 deletions

View File

@ -916,7 +916,9 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
publishEvent(new ContextRefreshedEvent(this));
// Participate in LiveBeansView MBean, if active.
LiveBeansView.registerApplicationContext(this);
if (!IN_NATIVE_IMAGE) {
LiveBeansView.registerApplicationContext(this);
}
}
/**
@ -1024,7 +1026,9 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
logger.debug("Closing " + this);
}
LiveBeansView.unregisterApplicationContext(this);
if (!IN_NATIVE_IMAGE) {
LiveBeansView.unregisterApplicationContext(this);
}
try {
// Publish shutdown event.