We have an webapp running fine on Tomcat 8.5.50 and below and we used a
custom WebappClassLoader to load jars (common path for jars), but it failed
to load on Tomcat 8.5.51 and above. Upon checking, we noticed that
javax.servlet.ServletContainerInitializer that we defined in the jar is not
being loaded.

>From org.apache.catalina.startup.WebappServiceLoader source code of Tomcat
8.5.51, the classLoader was changed from servletContext.getClassloader()
(Tomcat 8.5.50 line 97) to context.getParentClassLoader() (Tomcat 8.5.51
line 144)

However placing the jar at WEB-INF/lib it was able to load
javax.servlet.ServletContainerInitializer. The problem is when the jar is
outside of WEB-INF/lib or common path (/opt/client/libraries/test.jar).

Thanks

Reply via email to