1
votes

This is the first time I am using Jenkins. Manage Jenkins > Manage Plugins > Available tab > Maven selected > Downloading is done.

When I go to New item page, I still do not see Maven. I guess I need to restart Jenkins.

I tried localhost:8080/reload, localhost:8080/restart, and http://localhost:8080/safeRestart. I get error "Jenkins cannot restart itself as currently configured."

I still see command prompt is running.

enter image description here

In addition, I cd to jenkins folder and tried to restart from there but did not work.

jenkins.exe restart
2020-06-05 21:06:02,783 INFO  - Restarting the service with id 'jenkins'
2020-06-05 21:06:02,795 FATAL - WMI Operation failure: NoSuchService
WMI.WmiException: NoSuchService
   at winsw.WrapperService.ThrowNoSuchService()
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)
WMI.WmiException: NoSuchService
   at winsw.WrapperService.ThrowNoSuchService()
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)

How can I restart Jenkins on windows machine?


Update 1

I took the following steps at the beginning to install and launch jenkins.

https://updates.jenkins-ci.org/download/war/ Downloaded war file Created a folder Jenkins in c drive and moved the downloaded war to the Jenkins folder

Opened command prompt cd to the jenkins folder java -jar Jenkins.war It gave me temp password

localhost:8080 Pasted the password

Created an account. Downloaded maven plugin in Jenkins. I do not see Maven plugin listed in Jenkins. After that, I am not sure how to restart Jenkins. I will go thru the wiki guide to install it as a windows service. Is there way to fix it without installing it as a windows service?


Update 2

When I try to install is a windows service, I get this

"

Error
Installing a service
[.jenkins] $ "C:\Users\Owner PC\.jenkins\jenkins.exe" install
2020-06-06 12:44:30,771 INFO  - Installing the service with id 'jenkins'
2020-06-06 12:44:30,859 FATAL - WMI Operation failure: AccessDenied
WMI.WmiException: AccessDenied
   at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result)
   at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args)
   at WMI.Win32ServicesProxy.Create(String , String , String , ServiceType , ErrorControl , StartMode , Boolean , String , String , String[] )
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)
WMI.WmiException: AccessDenied
   at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result)
   at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args)
   at WMI.Win32ServicesProxy.Create(String , String , String , ServiceType , ErrorControl , StartMode , Boolean , String , String , String[] )
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)"

Update 3

I deleted everything from the jenkins folder.

Open command prompt as admin.

Ran this command java -java jenkins.war. Last few links of the command prompt:

        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
2020-06-06 18:53:28.976+0000 [id=21]    INFO    jenkins.model.Jenkins#cleanUp: S
topping Jenkins
2020-06-06 18:53:29.106+0000 [id=21]    INFO    jenkins.model.Jenkins$18#onAttai
ned: Started termination
2020-06-06 18:53:29.107+0000 [id=21]    SEVERE  jenkins.model.Jenkins$18#onTaskF
ailed: Failed NioChannelSelector.cleanUp
java.lang.IllegalArgumentException: Unable to inject class jenkins.slaves.NioCha
nnelSelector
        at hudson.init.TaskMethodFinder.lookUp(TaskMethodFinder.java:125)
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
        at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
        at jenkins.model.Jenkins$17.execute(Jenkins.java:3495)
        at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139)

        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:128)
        at jenkins.model.Jenkins$17.execute(Jenkins.java:3495)
        at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139)

        at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:276)
        at jenkins.model.Jenkins._cleanUpRunTerminators(Jenkins.java:3492)
        at jenkins.model.Jenkins.cleanUp(Jenkins.java:3417)
        at hudson.WebAppMain$3.run(WebAppMain.java:283)
2020-06-06 18:53:29.140+0000 [id=21]    SEVERE  jenkins.model.Jenkins$18#onTaskF
ailed: Failed IOHubProvider.cleanUp
java.lang.IllegalArgumentException: Unable to inject class jenkins.slaves.IOHubP
rovider
        at hudson.init.TaskMethodFinder.lookUp(TaskMethodFinder.java:125)
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
        at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
        at jenkins.model.Jenkins$17.execute(Jenkins.java:3495)
        at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139)

        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:128)
        at jenkins.model.Jenkins$17.execute(Jenkins.java:3495)
        at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139)

        at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:276)
        at jenkins.model.Jenkins._cleanUpRunTerminators(Jenkins.java:3492)
        at jenkins.model.Jenkins.cleanUp(Jenkins.java:3417)
        at hudson.WebAppMain$3.run(WebAppMain.java:283)
2020-06-06 18:53:29.143+0000 [id=21]    INFO    jenkins.model.Jenkins$18#onAttai
ned: Completed termination
2020-06-06 18:53:29.143+0000 [id=21]    INFO    jenkins.model.Jenkins#_cleanUpDi
sconnectComputers: Starting node disconnection
2020-06-06 18:53:29.148+0000 [id=21]    INFO    jenkins.model.Jenkins#_cleanUpSh
utdownPluginManager: Stopping plugin manager
2020-06-06 18:53:29.309+0000 [id=21]    INFO    c.b.j.cascade.PluginActivator#st
op: ### Stop.
2020-06-06 18:53:29.311+0000 [id=21]    INFO    jenkins.model.Jenkins#_cleanUpPe
rsistQueue: Persisting build queue
2020-06-06 18:53:29.385+0000 [id=21]    INFO    jenkins.model.Jenkins#cleanUp: J
enkins stopped
1
You don't mention how you launched Jenkins. If cmd line java -jar jenkins.war, you can't restart, just Ctrl-C or safeExitIan W
Please see the update.GreenTree

1 Answers

2
votes

The error log above gives some hint:

jenkins.exe restart
2020-06-05 21:06:02,783 INFO  - Restarting the service with id 'jenkins'
2020-06-05 21:06:02,795 FATAL - WMI Operation failure: NoSuchService
WMI.WmiException: NoSuchService

Since Jenkins is not installed as a Windows service, you are facing issue. First install it as a Windows service using the link provided below and then it should work. For that, go to Manage Jenkins section and there you will see an option Install as Windows Service. Once you will install Jenkins as a service, you will see a service with the name jenkins created as shown below:

enter image description here

https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+as+a+Windows+service