title: RuntimeException at line1 of any ServletContextListener using Netbeans and Tomcat
body: <p>I'm using Netbeans 12.3 as IDE and I was used to manage different webapplication projects serviced by tomcat.</p>
  <p>From a day to another I cannot run any web project anymore.</p>
  <p>I even tested with a new empty project and an empty ServletContextListener implementation</p>
  <pre><code>package stica;
  
  import javax.servlet.ServletContextEvent;
  import javax.servlet.ServletContextListener;
  
  public class NewServletListener implements ServletContextListener {
  
      @Override
      public void contextInitialized(ServletContextEvent sce) {}
  
      @Override
      public void contextDestroyed(ServletContextEvent sce) {}
  }
  </code></pre>
  <p>The results are the same for all my web applications:</p>
  <pre><code>30-Jun-2021 21:37:00.981 GRAVE [http-nio-8080-exec-28] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [stica.NewServletListener]
      java.lang.RuntimeException: 
          at stica.NewServletListener.&lt;init&gt;(NewServletListener.java:1)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:151)
          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4640)
          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:692)
          at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:689)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:537)
          at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1683)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:288)
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
          at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
          at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1592)
          at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:1021)
          at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:356)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
          at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
          at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:667)
          at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:378)
          at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:56)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
          at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
          at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
          at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
          at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
          at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:748)
  30-Jun-2021 21:37:00.981 GRAVE [http-nio-8080-exec-28] org.apache.catalina.core.StandardContext.listenerStart Skipped installing application listeners due to previous error(s)
  </code></pre>
  <p>The listener is loaded using web.xml:</p>
  <pre><code>&lt;listener&gt;
      &lt;description&gt;ServletContextListener&lt;/description&gt;
      &lt;listener-class&gt;stica.NewServletListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  <p>RuntimeException at line 1 with no other meaningful (at least not to me) explanations.</p>
  <p>I tryed different versions of Tomcat (8.5.50, 9.0.44, 9.0.46) and different combination of jdk for sources, libraries etcetera (8 and 14, the base for the IDE).
  I even tryed with two netbeans versions: 12 and 12.3.</p>
  <p>The projects doesn't run, no matter what I do.</p>
  <p>I am desperate.</p>