Unable to shutdown JBoss AS 7.1.1 on Windows using the CLI
sbass Nov 26, 2014 8:10 PMHi,
I've got a standalone server listening on non-default ports (port-offset=300). I've tried using jboss-cli.bat to shutdown the server, but I can only get it to work in interactive mode. I've got a similar jboss-cli.ps1 script (from the WildFly GitHub), but it too has the same errors.
To me it looks like the arguments aren't getting parsed correctly, but that's just my guess.
Here is output from the jboss-cli.bat session. Any ideas how to get this to work?
D:\jboss-as-7.1.1.Final\bin>jboss-cli.bat
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect localhost:10299 <<< THIS WORKS
[standalone@localhost:10299 /] :shutdown <<< THIS WORKS
{"outcome" => "success"}
[standalone@localhost:10299 /] quit
Press any key to continue . . .
D:\jboss-as-7.1.1.Final\bin>jboss-cli.bat --connect localhost:10299 <<< THIS FAILS, SAME SETTING AS THE INTERACTIVE SESSION
org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:229)
at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:195)
at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at localhost:9999
at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:639)
at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:613)
at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:227)
... 8 more
Press any key to continue . . .
D:\jboss-as-7.1.1.Final\bin>jboss-cli.bat --connect :10299
org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:229)
at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:195)
at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at localhost:9999
at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:639)
at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:613)
at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:227)
... 8 more
Press any key to continue . . .
D:\jboss-as-7.1.1.Final\bin>jboss-cli.bat --connect localhost:10299 --command=:shutdown <<< THIS IS REJECTED WITHOUT EVEN ATTEMPTING TO CONNECT
Duplicate argument '--command'/'--commands'.
Press any key to continue . . .
D:\jboss-as-7.1.1.Final\bin>
For the last example, I also tried:
-command=:shutdown
command=:shutdown
:shutdown
All with the same error.and=:shutdown