Bug 977407

Summary: jboss-cli.sh throws IllegalArgumentException when using tab complete
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Thomas Hauser <thauser>
Component: CLIAssignee: Alexey Loubyansky <olubyans>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: brian.stansberry, cdewolf, myarboro, pkremens
Target Milestone: ER1   
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In some situations the `jboss-cli` tool was exiting when the tab completion feature was triggered by the user. This has been fixed and tab completion now works as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:21:25 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:
Embargoed:

Description Thomas Hauser 2013-06-24 13:30:57 UTC
Description of problem:
When using tab complete to try and auto-fill values or get hints as to the allowed values for certain attributes, an IllegalArgumentException is thrown.

Version-Release number of selected component (if applicable):
I believe it to be 7.2.0.Final-redhat-8. 

How reproducible:
Always.

Steps to Reproduce:
1) Start the server in standalone or domain mode. (Either --admin-only or normal).

2) Start the jboss-cli.sh session:
./jboss-cli.sh -c

3) Run the following command to create a security-domain:
Standalone:
/subsystem=security/security-domain=new:add()
Domain:
/profile=full/subsystem=security/security-domain=new:add()

4) Enter the following text: 
Standalone:
/subsystem=security/security-domain=new/jsse=classic:add(keystore={password=
Domain:
/profile=full/subsystem=security/security-domain=new/jsse=classic:add(keystore={password=

5) Press tab.
View stacktrace: http://pastebin.test.redhat.com/148578

Actual results:
Stacktrace is thrown and jboss-cli.sh crashes completely.

Expected results:
Either helper values are displayed, or nothing is displayed (depending upon the type of the attribute in question)

Additional info:
Would be nice to have this fixed for the upcoming SOA release.

Comment 1 Thomas Hauser 2013-06-24 13:56:03 UTC
See https://issues.jboss.org/browse/WFLY-1574

Comment 3 Thomas Hauser 2013-08-02 15:53:25 UTC
This issue also occurs whenever trying to use tab complete in the following situation:

1) [domain@localhost:9999 /] /subsystem=(

2) [domain@localhost:9999 /] /=(

Pressing tab in any case where a field should contain something before the ( character results in this stacktrace: 

java.lang.IllegalArgumentException: The argument value is not specified for name: 'null'
	at org.jboss.as.cli.operation.impl.DefaultOperationRequestBuilder.addProperty(DefaultOperationRequestBuilder.java:113)
	at org.jboss.as.cli.operation.impl.DefaultOperationCandidatesProvider.getProperties(DefaultOperationCandidatesProvider.java:209)
	at org.jboss.as.cli.operation.impl.DefaultOperationCandidatesProvider.getProperties(DefaultOperationCandidatesProvider.java:52)
	at org.jboss.as.cli.operation.OperationRequestCompleter.complete(OperationRequestCompleter.java:142)
	at org.jboss.as.cli.CommandCompleter.complete(CommandCompleter.java:95)
	at org.jboss.as.cli.impl.Console$Factory$1$1.complete(Console.java:101)
	at org.jboss.aesh.console.Console.complete(Console.java:1087)
	at org.jboss.aesh.console.Console.parseOperation(Console.java:486)
	at org.jboss.aesh.console.Console.read(Console.java:389)
	at org.jboss.aesh.console.Console.read(Console.java:341)
	at org.jboss.as.cli.impl.Console$Factory$1.readLine(Console.java:177)
	at org.jboss.as.cli.impl.CommandContextImpl.interact(CommandContextImpl.java:1182)
	at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:259)
	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:270)
	at org.jboss.modules.Main.main(Main.java:411)

Comment 5 Petr Kremensky 2013-09-18 09:49:33 UTC
Verified on EAP 6.2.0.ER2