SystemInstance.get().setComponent(ParentClassLoaderFinder.class, new ProvidedClassLoaderFinder(loader));
Runtime.getRuntime().addShutdownHook(hook);
if (!classpathAsWar) {
container.deploy('/' + (context == null ? warFile.getName() : context), warFile, true);
} else {
if (useProjectClasspath) {
thread.setContextClassLoader(createClassLoader(loader));
}
container.deployClasspathAsWebApp(context, docBase); // null is handled properly so no issue here