try {
super.processServletContainerInitializers(ctx);
final Iterator<Map.Entry<ServletContainerInitializer,Set<Class<?>>>> iterator = initializerClassMap.entrySet().iterator();
while (iterator.hasNext()) {
final Map.Entry<ServletContainerInitializer, Set<Class<?>>> entry = iterator.next();
final ServletContainerInitializer sci = entry.getKey();
final String classname = sci.getClass().getName();
if (classname.equals("org.apache.myfaces.ee6.MyFacesContainerInitializer")
|| classname.equals("org.springframework.web.SpringServletContainerInitializer")) {
for (final Map.Entry<Class<?>, Set<ServletContainerInitializer>> scanning : typeInitializerMap.entrySet()) {
final Set<ServletContainerInitializer> scis = scanning.getValue();
if (scis != null && scis.contains(sci)) {
scis.remove(sci);
}
}
iterator.remove();
} else if ("org.apache.jasper.servlet.JasperInitializer".equals(classname)) {
iterator.remove();
}
}
initializerClassMap.put(new TomEEJasperInitializer(), new HashSet<Class<?>>());
final ClassLoader loader = context.getLoader().getClassLoader();
// spring-web (not scanned)
try {
final Class<?> initializer = Class.forName("org.springframework.web.SpringServletContainerInitializer", true, loader);
final ServletContainerInitializer instance = (ServletContainerInitializer) initializer.newInstance();
typeInitializerMap.put(Class.forName("org.springframework.web.WebApplicationInitializer", true, loader), Collections.singleton(instance));
initializerClassMap.put(instance, new HashSet<Class<?>>());
} catch (final Exception | NoClassDefFoundError ignored) {
// no-op
}