remove MBeanCleanUp step to avoid exception on restart

This commit is contained in:
Sebastian Sdorra
2019-06-20 15:09:12 +02:00
parent d658a1a662
commit eec4b282e6
2 changed files with 3 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import se.jiderhamn.classloader.leak.prevention.ClassLoaderLeakPreventor;
import se.jiderhamn.classloader.leak.prevention.ClassLoaderLeakPreventorFactory;
import se.jiderhamn.classloader.leak.prevention.cleanup.MBeanCleanUp;
import sonia.scm.plugin.ChildFirstPluginClassLoader;
import sonia.scm.plugin.DefaultPluginClassLoader;
@@ -36,6 +37,7 @@ public final class ClassLoaderLifeCycle {
public static ClassLoaderLifeCycle create() {
ClassLoaderLeakPreventorFactory classLoaderLeakPreventorFactory = new ClassLoaderLeakPreventorFactory();
classLoaderLeakPreventorFactory.setLogger(new LoggingAdapter());
classLoaderLeakPreventorFactory.removeCleanUp(MBeanCleanUp.class);
return new ClassLoaderLifeCycle(Thread.currentThread().getContextClassLoader(), classLoaderLeakPreventorFactory);
}