My project is using spring boot
with webflux
, tomcat
.
I have a internal library class that is a ServletContextListener
@WebListener
public class DevIoServletContextListener implements ServletContextListener {
@Inject
private DevIoInjector injector;
public DevIoServletContextListener() {
}
public void contextInitialized(ServletContextEvent event) {
this.injector.inject();
}
public void contextDestroyed(ServletContextEvent event) {
}
}
This internal class throws an exception inside method contextInitialized
:
[ERROR ] SRVE0283E: Exception caught while initializing context: java.lang.NullPointerException
at br.com.dev.lib.DevIoServletContextListener.contextInitialized(DevIoServletContextListener.java:33)
this class is not important for my development.. i would like ignore or disable this listener, is possible?
I don't make changes inside this listener because is an internal class from a library.
I will appreciate any help.
I tried add @ServletComponentScan("br.com.dev.bit.io") with my packages only inside main class, but not worked.
@SpringBootApplication
@EnableAutoConfiguration
@ComponentScan("br.com.dev.bit.io")
@ServletComponentScan("br.com.dev.bit.io")
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}