return; // no need to replace the loader
}
// we just want to wrap it to lazy stop it (afterstop)
// to avoid classnotfound in @PreDestoy or destroyApplication()
final VirtualWebappLoader loader = new ProvisioningWebappLoader();
loader.setDelegate(standardContext.getDelegate());
loader.setLoaderClass(LazyStopWebappClassLoader.class.getName());
if (VirtualWebappLoader.class.isInstance(standardContextLoader)) {
final VirtualWebappLoader vwl = VirtualWebappLoader.class.cast(standardContextLoader);
loader.setSearchVirtualFirst(vwl.getSearchVirtualFirst());
loader.setVirtualClasspath(String.class.cast(Reflections.get(vwl, "virtualClasspath")));
}
final Loader lazyStopLoader = new LazyStopLoader(loader);
standardContext.setLoader(lazyStopLoader);