org.jboss.as.cli.CliInitializationException: Failed to connect to the controller

JBoss Issue Tracker | Darran Lofthouse | 3 years ago
  1. 0

    Port 9999 is by default the native management interface. The command './jboss-cli.sh -c --controller=localhost:9999' results in the following error: - {code} org.jboss.as.cli.CliInitializationException: Failed to connect to the controller at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:291) at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:269) 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:601) at org.jboss.modules.Module.run(Module.java:270) at org.jboss.modules.Main.main(Main.java:411) Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at localhost:9999 at org.jboss.as.cli.impl.CommandContextImpl.tryConnection(CommandContextImpl.java:967) at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:806) at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:778) at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:289) ... 8 more Caused by: java.io.IOException: java.net.ConnectException: JBAS012144: Could not connect to http-remoting://localhost:9999. The connection timed out at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71) at org.jboss.as.cli.impl.CommandContextImpl.tryConnection(CommandContextImpl.java:945) ... 11 more Caused by: java.net.ConnectException: JBAS012144: Could not connect to http-remoting://localhost:9999. The connection timed out at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:131) at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256) at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70) at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:176) at org.jboss.as.cli.impl.CLIModelControllerClient.getOrCreateChannel(CLIModelControllerClient.java:162) at org.jboss.as.cli.impl.CLIModelControllerClient$2.getChannel(CLIModelControllerClient.java:124) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:115) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:90) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127) ... 13 more {code} This is because the use of HTTP upgrade is assumed, however clients using the CLI from previous versions were used to using this connection command against the native management interface only. Workaround: - Add the URI scheme to the controller paramter: - {code} ./jboss-cli.sh -c --controller=remote://localhost:9999 {code}

    JBoss Issue Tracker | 3 years ago | Darran Lofthouse
    org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
  2. 0

    Port 9999 is by default the native management interface. The command './jboss-cli.sh -c --controller=localhost:9999' results in the following error: - {code} org.jboss.as.cli.CliInitializationException: Failed to connect to the controller at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:291) at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:269) 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:601) at org.jboss.modules.Module.run(Module.java:270) at org.jboss.modules.Main.main(Main.java:411) Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at localhost:9999 at org.jboss.as.cli.impl.CommandContextImpl.tryConnection(CommandContextImpl.java:967) at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:806) at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:778) at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:289) ... 8 more Caused by: java.io.IOException: java.net.ConnectException: JBAS012144: Could not connect to http-remoting://localhost:9999. The connection timed out at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71) at org.jboss.as.cli.impl.CommandContextImpl.tryConnection(CommandContextImpl.java:945) ... 11 more Caused by: java.net.ConnectException: JBAS012144: Could not connect to http-remoting://localhost:9999. The connection timed out at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:131) at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256) at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70) at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:176) at org.jboss.as.cli.impl.CLIModelControllerClient.getOrCreateChannel(CLIModelControllerClient.java:162) at org.jboss.as.cli.impl.CLIModelControllerClient$2.getChannel(CLIModelControllerClient.java:124) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:115) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:90) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127) ... 13 more {code} This is because the use of HTTP upgrade is assumed, however clients using the CLI from previous versions were used to using this connection command against the native management interface only. Workaround: - Add the URI scheme to the controller paramter: - {code} ./jboss-cli.sh -c --controller=remote://localhost:9999 {code}

    JBoss Issue Tracker | 3 years ago | Darran Lofthouse
    org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.ConnectException

    JBAS012144: Could not connect to http-remoting://localhost:9999. The connection timed out

    at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync()
  2. JBoss Application Server: Protocol Utilities
    FutureManagementChannel$Establishing.getChannel
    1. org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:131)
    2. org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256)
    3. org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
    4. org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:176)
    4 frames
  3. JBoss Application Server: Command line interface
    CLIModelControllerClient$2.getChannel
    1. org.jboss.as.cli.impl.CLIModelControllerClient.getOrCreateChannel(CLIModelControllerClient.java:162)
    2. org.jboss.as.cli.impl.CLIModelControllerClient$2.getChannel(CLIModelControllerClient.java:124)
    2 frames
  4. JBoss Application Server: Protocol Utilities
    ManagementChannelHandler.executeRequest
    1. org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:115)
    2. org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:90)
    2 frames
  5. JBoss Application Server: Controller Client
    AbstractModelControllerClient.execute
    1. org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236)
    2. org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141)
    3. org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
    4. org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71)
    4 frames
  6. JBoss Application Server: Command line interface
    CommandLineMain.main
    1. org.jboss.as.cli.impl.CommandContextImpl.tryConnection(CommandContextImpl.java:945)
    2. org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:806)
    3. org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:778)
    4. org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:289)
    5. org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:269)
    6. org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
    6 frames
  7. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:601)
    4 frames
  8. JBoss Modules
    Main.main
    1. org.jboss.modules.Module.run(Module.java:270)
    2. org.jboss.modules.Main.main(Main.java:411)
    2 frames