0 votes
1 view
in Devops and Agile by (28.1k points)
edited by

I have installed Jenkins v2.225 on my PC Windows 10, it opened up first time on localhost:8080, then I added maven plugins for maven projects, it (Jenkins plugin manager) asked for restart, I did restart, but Jenkins is not coming up on localhost:8080 now.

I tried to uninstall/reinstall/repair, but no luck.

Could you please help me to set up Jenkins on my PC windows 10?

I did try from the command line, to start Jenkins, it gave me an error:

Command:

C:\Program Files (x86)\Jenkins> java -jar jenkins.war

 Error:

 Error: localhost:8080 

java.lang.IllegalStateException: Expected 1 instance of hudson.PluginManager$PluginUpdateMonitor but got 0

at hudson.ExtensionList.lookupSingleton(ExtensionList.java:451)

at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:2187)

at hudson.maven.PluginImpl.init(PluginImpl.java:58)

Caused: java.lang.reflect.InvocationTargetException

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 hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)

Caused: java.lang.Error

at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)

at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)

at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)

at jenkins.model.Jenkins$5.runTask(Jenkins.java:1133)

at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)

at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)

at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused: org.jvnet.hudson.reactor.ReactorException

at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)

at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)

at jenkins.model.Jenkins.executeReactor(Jenkins.java:1166)

at jenkins.model.Jenkins.<init>(Jenkins.java:966)

at hudson.model.Hudson.<init>(Hudson.java:85)

at hudson.model.Hudson.<init>(Hudson.java:81)

at hudson.WebAppMain$3.run(WebAppMain.java:233)

Caused: hudson.util.HudsonFailedToLoad

at hudson.WebAppMain$3.run(WebAppMain.java:250)

After trying that command it got the following error.

PS C:\Program Files (x86)\Jenkins> java -jar jenkins.war Running from: C:\Program Files (x86)\Jenkins\jenkins.war webroot: $user.home/.jenkins 2020-03-15 12:24:35.992+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @471ms to org.eclipse.jetty.util.log.JavaUtilLog 2020-03-15 12:24:36.068+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file 2020-03-15 12:24:36.094+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath 2020-03-15 12:24:36.139+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.27.v20200227; built: 2020-02-27T18:37:21.340Z; git: a304fd9f351f337e7c0e2a7c28878dd536149c6c; jvm 1.8.0_241-b07 2020-03-15 12:24:38.354+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet 2020-03-15 12:24:38.406+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0 2020-03-15 12:24:38.406+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults 2020-03-15 12:24:38.409+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms 2020-03-15 12:24:38.717+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: C:\Users\44742\.jenkins found at: $user.home/.jenkins 2020-03-15 12:24:38.803+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStart: Started [email protected]{Jenkins v2.225,/,file:///C:/Users/44742/.jenkins/war/,AVAILABLE}{C:\Users\44742\.jenkins\war} 2020-03-15 12:24:38.814+0000 [id=1] INFO o.e.j.server.AbstractConnector#doStop: Stopped [email protected]{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} 2020-03-15 12:24:38.815+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#stopScavenging: node0 Stopped scavenging 2020-03-15 12:24:38.817+0000 [id=1] INFO hudson.WebAppMain#contextDestroyed: 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:940) at org.eclipse.jetty.servlet.ServletContextHandler.callContextDestroyed(ServletContextHandler.java:565) at org.eclipse.jetty.server.handler.ContextHandler.stopContext(ContextHandler.java:908) at org.eclipse.jetty.servlet.ServletContextHandler.stopContext(ServletContextHandler.java:367) at org.eclipse.jetty.webapp.WebAppContext.stopWebapp(WebAppContext.java:1450) at org.eclipse.jetty.webapp.WebAppContext.stopContext(WebAppContext.java:1415) at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:983) at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:284) at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:547) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93) at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201) at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:108) at org.eclipse.jetty.server.Server.doStop(Server.java:454) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93) at winstone.Launcher.shutdown(Launcher.java:304) at winstone.Launcher.<init>(Launcher.java:195) at winstone.Launcher.main(Launcher.java:355) 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:375) at Main.main(Main.java:151) 2020-03-15 12:24:38.821+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStop: Stopped [email protected]{Jenkins v2.225,/,null,UNAVAILABLE}{C:\Users\44742\.jenkins\war} Exception in thread "Jenkins initialization thread" java.lang.NoClassDefFoundError: hudson/util/HudsonFailedToLoad at hudson.WebAppMain$3.run(WebAppMain.java:247) Caused by: java.lang.ClassNotFoundException: hudson.util.HudsonFailedToLoad at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:543) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more 2020-03-15 12:24:38.822+0000 [id=1] INFO winstone.Logger#logInternal: Jetty shutdown successfully java.io.IOException: Failed to start Jetty at winstone.Launcher.<init>(Launcher.java:184) at winstone.Launcher.main(Launcher.java:355) 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:375) at Main.main(Main.java:151) Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080 at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346) at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.server.Server.doStart(Server.java:385) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at winstone.Launcher.<init>(Launcher.java:182) ... 7 more Caused by: java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342) ... 14 more 2020-03-15 12:24:38.925+0000 [id=1] SEVERE winstone.Logger#logInternal: Container startup failed java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342) Caused: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080 at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346) at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.server.Server.doStart(Server.java:385) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at winstone.Launcher.<init>(Launcher.java:182) Caused: java.io.IOException: Failed to start Jetty at winstone.Launcher.<init>(Launcher.java:184) at winstone.Launcher.main(Launcher.java:355) 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:375) at Main.main(Main.java:151) 

PS C:\Program Files (x86)\Jenkins> 

1 Answer

0 votes
by (48k points)
edited by

It looks like the issue was caused as you've already used the HTTP port,8080 before (when you first installed the Jenkins) and that is causing you to not use the same port again. Here are a few workarounds:

1) You can assign a different HTTP port number, say 8383 using the command:

java -jar jenkins.war --httpPort=8383

Or

2) If you want to use the default port (8080), you can simply kill the process that's already running with the port number 8080 and start Jenkins normally. For this, you need to first find the process that's using the HTTP port 8080.

Use the command: netstat -ano|find "8080"

You should note the PID of that process.

Later, you need to kill that process. Use this command:

taskkill /PID <insert-the-PID-you-got-from-above-step> /F

Now, you can normally start the Jenkins and you shouldn't see any error.

For more information, check out this jenkins tutorial

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...