Bug 716326

Summary: NPE in ClientMain.main() when calling rhq-cli.sh with --file
Product: [Other] RHQ Project Reporter: Ondřej Žižka <ozizka>
Component: CLIAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 3.0.0CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Ondřej Žižka 2011-06-23 20:52:19 EDT
ondra@ondra-redhat: ~/work/JON/SVN-QA $ rhq-cli/bin/rhq-cli.sh -u rhqadmin -p rhqadmin --host $RHQ_HOST  --file
export JAVA_HOME=/home/ondra/sw/tools/jdk/sun160
Remote server version is: 3.0.1.GA(81e26be20d)
Login successful
Exception in thread "main" java.lang.NullPointerException
        at java.io.File.<init>(File.java:222)
        at org.rhq.enterprise.client.commands.ScriptCommand.bindScriptArgs(ScriptCommand.java:288)
        at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:121)
        at org.rhq.enterprise.client.ClientMain.processArguments(ClientMain.java:505)
        at org.rhq.enterprise.client.ClientMain.main(ClientMain.java:106)
ondra@ondra-redhat: ~/work/JON/SVN-QA $
Comment 1 Ondřej Žižka 2011-06-23 20:54:52 EDT
Does the same with

touch x
~/work/JON/SVN-QA $ rhq-cli/bin/rhq-cli.sh -u rhqadmin -p
rhqadmin --host $RHQ_HOST  --file x
Comment 2 Ondřej Žižka 2011-06-23 21:14:21 EDT
-f works.

Something is wrong in CmdLineParser.java.
Comment 3 Ondřej Žižka 2011-06-23 21:17:47 EDT
I don't like getopts.