STR: 1) Install CLI 2) Run bin/rhq-client.sh 3) Type rhq.<Tab> NPE will occur: RHQ - RHQ Enterprise Remote CLI 3.0.1.GA unconnected$ rhq.java.lang.NullPointerException at org.rhq.enterprise.client.InteractiveJavascriptCompletor.complete(InteractiveJavascriptCompletor.java:131) at jline.MultiCompletor.complete(MultiCompletor.java:53) at jline.ConsoleReader.complete(ConsoleReader.java:832) at jline.ConsoleReader.readLine(ConsoleReader.java:518) at jline.ConsoleReader.readLine(ConsoleReader.java:448) at org.rhq.enterprise.client.ClientMain.getUserInput(ClientMain.java:189) at org.rhq.enterprise.client.ClientMain$1.run(ClientMain.java:237) at java.lang.Thread.run(Thread.java:662)
NPEs are always a bug - is related to (and probably a duplicate of ) BZ 743379
In org.rhq.enterprise.client.InteractiveJavascriptCompletor#complete (line 131) Object rootObject = context.getAttribute(call[0]); the context is null -- probably because the user is not logged in and so command completion is not yet ready. We nevertheless should not NPE here, but indicate to the user that he needs to log in.
This should be fixed with the fix for bug 743379
documenting the verification. RHQ 10/13/2011 build. RHQ - RHQ Enterprise Remote CLI 4.1.0-SNAPSHOT Remote server version is: 4.1.0-SNAPSHOT (81e6d65) Login successful rhqadmin@localhost:7080$ rhq.log login logout rhqadmin@localhost:7080$ rhq.l
(In reply to comment #5) > documenting the verification. RHQ 10/13/2011 build. > > RHQ - RHQ Enterprise Remote CLI 4.1.0-SNAPSHOT > Remote server version is: 4.1.0-SNAPSHOT (81e6d65) > Login successful > rhqadmin@localhost:7080$ rhq.log > > login logout > rhqadmin@localhost:7080$ rhq.l How did you start the CLI? Did you pass the credentials to the rhq-cli.sh directly (as would be suggested by the "Login successful" appearing before the prompt)? This bug would only manifest itself when trying to use the CLI while not logged on. You need to start the CLI without any parameters so that the prompt at the start says "unconnected$" instead of "username@server$".
documenting verification [mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh RHQ - RHQ Enterprise Remote CLI 4.1.0-SNAPSHOT unconnected$ rhq.log login logout unconnected$ rhq.log
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE