Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-1512

jboss-cli.sh throws NPE in batch mode with certain commands

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.0.0.Alpha2
    • 8.0.0.Alpha2
    • CLI
    • None
    • Hide

      To reproduce:
      1) Run wildfly in standalone mode.
      2) Run jboss-cli.sh, but do not connect.
      3) Enter batch mode in jboss-cli.sh
      4) Run the following command: data-source add --name=test --connection-url=test --jndi-name=java:/ --driver-name=h2

      Stacktrace here: http://pastebin.com/9LEVh0u9

      Show
      To reproduce: 1) Run wildfly in standalone mode. 2) Run jboss-cli.sh, but do not connect. 3) Enter batch mode in jboss-cli.sh 4) Run the following command: data-source add --name=test --connection-url=test --jndi-name=java:/ --driver-name=h2 Stacktrace here: http://pastebin.com/9LEVh0u9
    • Compatibility/Configuration
    • Hide

      None possible. Adding certain commands to a disconnected batch is impossible currently.

      Show
      None possible. Adding certain commands to a disconnected batch is impossible currently.

    Description

      When the jboss-cli.sh (and by extension, the CommandContext API in java) is given certain commands while not connected to the client, an unhandled NPE is thrown from org.jboss.as.cli.handlers.GenericTypeOperationHandler.getOperationDescription(GenericTypeOperationHandler.java:886)

      Certain other commands succeed:

      [disconnected / #] /subsystem=datasources/jdbc-driver=ibmdb2:add(driver-name=ibmdb2,driver-module-name=com.ibm.db2)
      #1 /subsystem=datasources/jdbc-driver=ibmdb2:add(driver-name=ibmdb2,driver-module-name=com.ibm.db2)

      The line in question is here, in org.jboss.as.cli.handlers.GenericTypeOperationHandler:

      result = ctx.getModelControllerClient().execute(request);

      At the time of this call, the client field of the context is null; therefore, calling the execute method results in this NPE. This code is not hit with the /subsystem command because of some logic I see in CommandContextImpl.

      Attachments

        Activity

          People

            olubyans@redhat.com Alexey Loubyansky
            thauser_jira Thomas Hauser (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: