Bug 977426 - jboss-cli.sh throws NullPointerException while not connected and in batch mode
Summary: jboss-cli.sh throws NullPointerException while not connected and in batch mode
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER1
: EAP 6.2.0
Assignee: Alexey Loubyansky
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-24 14:08 UTC by Thomas Hauser
Modified: 2014-05-27 01:29 UTC (History)
4 users (show)

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 ----
Clone Of:
Environment:
Last Closed: 2013-12-15 16:23:01 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFLY-1512 0 Major Closed jboss-cli.sh throws NPE in batch mode with certain commands 2018-07-09 05:52:09 UTC

Description Thomas Hauser 2013-06-24 14:08:26 UTC
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 12:35:53 UTC
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.