Bug 1019232

Summary: jboss-cli.sh throws NullPointerException when using tab complete on data-source node
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: CLIAssignee: Joe Wertz <ewertz>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.0CC: atangrin, brian.stansberry, cdewolf, ewertz, kkhan, sgilda, smumford, twells
Target Milestone: ER5   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In previous versions of JBoss EAP 6, the `jboss-cli` tool would throw an exception and exit when the user attempted to use the tab completion feature in some circumstances. This was due to inadequate exception handling in the command parser for these situations and has been corrected in this release.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 14:38:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Petr Kremensky 2013-10-15 10:45:24 UTC
Description of problem:
 NullPointerException is thrown once using tab complete on "data-source --name=ExampleDS a"

Version-Release number of selected component (if applicable):
 EAP 6.2.0.ER5

How reproducible:
 always


Steps to Reproduce:
 1. Start out-of-box standalone.
 2. Connect to CLI 
 3. Enter (it is important to enter some char after datasource name): 
   - [standalone@localhost:9999 /] data-source --name=ExampleDS a
 4. Press TAB

Actual results:
 [standalone@localhost:9999 /] data-source --name=ExampleDS ajava.lang.NullPointerException
	at org.jboss.as.cli.operation.OperationRequestCompleter.complete(OperationRequestCompleter.java:145)
	at org.jboss.as.cli.CommandCompleter.complete(CommandCompleter.java:95)
	at org.jboss.as.cli.impl.Console$Factory$1$1.complete(Console.java:102)
	at org.jboss.aesh.console.Console.complete(Console.java:1151)
	at org.jboss.aesh.console.Console.parseOperation(Console.java:550)
	at org.jboss.aesh.console.Console.read(Console.java:452)
	at org.jboss.aesh.console.Console.read(Console.java:346)
	at org.jboss.as.cli.impl.Console$Factory$1.readLine(Console.java:178)
	at org.jboss.as.cli.impl.CommandContextImpl.interact(CommandContextImpl.java:1200)
	at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:263)
	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:606)
	at org.jboss.modules.Module.run(Module.java:292)
	at org.jboss.modules.Main.main(Main.java:455)


Expected results:
 Nothing is displayed

Comment 1 Alexey Loubyansky 2013-11-08 10:28:51 UTC
This is fixed upstream. Probably as https://issues.jboss.org/browse/WFLY-2204 runtime exceptions thrown during parsing crash cli sessions

Comment 2 sgilda 2014-05-14 19:16:54 UTC
I accidentally changed the jboss-eap-6.3.0 flag. 

Do you know who has permission to change it back to '+'?

Comment 3 Joe Wertz 2014-05-15 07:18:47 UTC
https://github.com/jbossas/jboss-eap/pull/1332

Comment 4 Petr Kremensky 2014-07-01 07:28:43 UTC
This one was left over.

Verified on EAP 6.3.0.ER8.