Search code examples
jenkinstomcat9

Why Jenkins startup fails on restart of Tomcat?


I was able to setup Jenkins 2.361.1 in Tomcat 9.0.67. It is running perfectly fine in http://localhost:8080/jenkins but if I try to restart tomcat by using shutdown.bat and then startup.bat, I get the following errors:

...
SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file
SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/jenkins] startup failed due to previous errors
INFO [main] hudson.lifecycle.Lifecycle.onStatusUpdate Stopping Jenkins
INFO [main] jenkins.model.Jenkins$16.onAttained Started termination
SEVERE [main] jenkins.model.Jenkins$16.onTaskFailed Failed NioChannelSelector.cleanUp
        java.lang.IllegalArgumentException: Unable to inject class jenkins.slaves.NioChannelSelector
                at hudson.init.TaskMethodFinder.lookUp(TaskMethodFinder.java:130)
                ...

http://localhost:8080 will still work fine but http://localhost:8080/jenkins displays a 404 page

Why am I getting that error even if I didn't change a thing after Tomcat shutdown? I used the zip file download to install Tomcat not the service installer.


Solution

  • The only workaround that works so far for me is to delete the jenkins folder inside the webapps folder and let tomcat redeploy it again. After doing that, no error occurred and jenkins worked just like before.