Bug 977426 - jboss-cli.sh throws NullPointerException while not connected and in batch mode
jboss-cli.sh throws NullPointerException while not connected and in batch mode
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ER1
: EAP 6.2.0
Assigned To: Alexey Loubyansky
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-24 10:08 EDT by Thomas Hauser
Modified: 2014-05-26 21:29 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Attempting to add a command to a batch with the `jboss-cli` tool when it was disconnected from the server would cause the `jboss-cli` to exit. This has been corrected. Attempting to add commands to a batch when disconnected from a server will now result in the following error message being displayed to the user: ---- Command is not supported or unavailable in the current context: Failed to load operation description: not connected ----
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-15 11:23:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-1512 Major Resolved jboss-cli.sh throws NPE in batch mode with certain commands 2016-12-27 20:08 EST

  None (edit)
Description Thomas Hauser 2013-06-24 10:08:26 EDT
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
Comment 3 Petr Kremensky 2013-09-18 08:35:53 EDT
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

Note You need to log in before you can comment on or make changes to this bug.