Sanjeev Chaudhary
Sanjeev Chaudhary

Reputation: 71

Jenkins -How to resolve "Shutting down a Jenkins instance that was still starting up" on windows machine

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

Answers (4)

goodvibes
goodvibes

Reputation: 3

try just http://localhost:8080/exit then restart jenkins with java -jar jenkins.war

Upvotes: 0

Rahul Modi
Rahul Modi

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

Jens
Jens

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

Sanjeev Chaudhary
Sanjeev Chaudhary

Reputation: 71

To resolve this issue, Please follow the below steps.

  1. Reach out to install folder of Jenkins: C:\Program Files (x86)\Jenkins
  2. Open jenkins.xml file in note pad.
  3. To change the port -Search-> --httpPort=8080 and change 8080 to 8383.
  4. Open command prompt and run find your system IPv4 Address. (E.g.- 172.161.46.173)
  5. Paste IP along with jenkins port into browser (E.g.- 172.161.46.173/8383) and hit Enter.
  6. It ask for Administration password: Get that password from: C:\Program Files (x86)\Jenkins\secrets\initialAdminPassword file
  7. Again It asked for plugin installation. Select the default.
  8. Once installation done - Click on continue.
  9. Now, Set username and password - Here, You are good to go and use jenkins.

enter image description here

Upvotes: 1

Related Questions