Reputation: 71
Getting Error while running Jenkins on command prompt using command: Java -jar jenkis.war
.. Tried several approaches but did not workout. Could you please help me on this.
Error: Shutting down a Jenkins instance that was still starting up
===========================================================================
INFO: Shutting down a Jenkins instance that was still starting up
java.lang.Throwable: reason
at hudson.WebAppMain.contextDestroyed(WebAppMain.java:388)
at org.eclipse.jetty.server.handler.ContextHandler.callContextDestroyed(ContextHandler.java:898)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextDestroyed(ServletContextHandler.java:545)
at org.eclipse.jetty.server.handler.ContextHandler.stopContext(ContextHandler.java:873)
at org.eclipse.jetty.servlet.ServletContextHandler.stopContext(ServletContextHandler.java:355)
at org.eclipse.jetty.webapp.WebAppContext.stopWebapp(WebAppContext.java:1521)
at org.eclipse.jetty.webapp.WebAppContext.stopContext(WebAppContext.java:1485)
at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:927)
at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:271)
at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:569)
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:144)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:162)
at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:124)
at org.eclipse.jetty.server.Server.doStop(Server.java:489)
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
at winstone.Launcher.shutdown(Launcher.java:307)
at winstone.Launcher.<init>(Launcher.java:167)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Main._main(Main.java:312)
at Main.main(Main.java:136)
Apr 20, 2018 12:30:08 PM org.eclipse.jetty.server.handler.ContextHandler doStop
INFO: Stopped w.@7807ac2c{/,null,UNAVAILABLE}{C:\Users\QA Team\.jenkins\war}
Exception in thread "Jenkins initialization thread"
Upvotes: 3
Views: 12859
Reputation: 3
try just http://localhost:8080/exit then restart jenkins with java -jar jenkins.war
Upvotes: 0
Reputation: 31
the root cause is default port 8080 is already being used, so in order to use it again, you need to kill PID used by that port, and then you can run again.
C:\Program Files\Java\jdk1.8.0_191\bin>netstat -ano|find "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 5256
TCP [::]:8080 [::]:0 LISTENING 5256
C:\Program Files\Java\jdk1.8.0_191\bin>taskkill /PID 5256 /F
SUCCESS: The process with PID 5256 has been terminated.
then you can start again
Upvotes: 0
Reputation: 2617
The root cause is that the requested http port is used by a different application if you started jenkins with command line: java -jar jenkins.war --httpPort=8080
change it to e.g.: java -jar jenkins.war --httpPort=8383
Upvotes: 8
Reputation: 71
Upvotes: 1