0

I am new to Jenkins. Here I have tried to restart Jenkins putting down this into cmd.

java -jar jenkins-cli.jar -s http://localhost:8080/ -webSocket safe-restart

Unfortunatly, I got this stacktrace

ERROR: Unexpected exception occurred while performing safe-restart command.
   hudson.lifecycle.RestartNotSupportedException: Default Windows lifecycle does not support restart.
    at hudson.lifecycle.Lifecycle$1.verifyRestartable(Lifecycle.java:84)
    at jenkins.model.Jenkins.restartableLifecycle(Jenkins.java:4305)
    at jenkins.model.Jenkins.safeRestart(Jenkins.java:4339)
    at jenkins.model.Jenkins.doSafeRestart(Jenkins.java:4294)
    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.cli.declarative.MethodBinder.call(MethodBinder.java:114)
    at hudson.cli.declarative.CLIRegisterer$1.main(CLIRegisterer.java:218)
    at hudson.cli.CLIAction$ServerSideImpl.run(CLIAction.java:277)
    at hudson.cli.CLIAction$1.lambda$opened$0(CLIAction.java:148)
    at java.lang.Thread.run(Unknown Source)

How can I solve this problem? (Safely restart jenkins from cmd)

Mikhail
  • 195
  • 2
  • 12

1 Answers1

0

If you are running the jenkins.war from the cmd line, either Linux or Windows, you cannot restart Jenkins. The application must be running as a service or a daemon (Java service wrapper OK too) for restart to work.

You can safeExit, then relaunch the app from the cmd line again.

Or, use the new Windows installer, but read this post and my comments on the installer.

Ian W
  • 4,559
  • 2
  • 18
  • 37