Description of problem: 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) Version-Release number of selected component (if applicable): 7.2.0.Final-redhat-8 How reproducible: Always. Steps to Reproduce: 1) Start the server in standalone or domain mode. 2) Run jboss-cli.sh, but do not connect. ./jboss-cli.sh 3) Enter batch mode in jboss-cli.sh batch 4) Run the following command: Standalone: data-source add --name=test --connection-url=test --jndi-name=java:/ --driver-name=h2 Domain: data-source add --profile=full --name=test --connection-url=test --jndi-name=java:/ --driver-name=h2 Stacktrace here: http://pastebin.test.redhat.com/148807 Actual results: jboss-cli.sh crashes with an NPE. Expected results: The command should either be added to the batch, or give a message about the command not being able to be run without being connected (running the same command while not in batch mode gives a nice error message, for example.) Additional info: See also: https://issues.jboss.org/browse/WFLY-1512
Verified on EAP 6.2.0.ER2. Adding the command to batch while disconnected now gives the error massage: Failed to add to batch '${commnad}': Command is not supported or unavailable in the current context: Failed to load operation description: not connected