Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1066108

Summary: [eap6] Confusing error message when empty plugin configuration is passed during creation of new datasource via CLI
Product: [Other] RHQ Project Reporter: Filip Brychta <fbrychta>
Component: CLIAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.10CC: hrupp, jshaughn
Target Milestone: ---   
Target Release: RHQ 4.13   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
cli script none

Description Filip Brychta 2014-02-17 17:35:12 UTC
Created attachment 864207 [details]
cli script

Description of problem:
I accidentally passed empty plugin configuration when creating a datasource via CLI and useless/confusing error message was shown. 

Version-Release number of selected component (if applicable):
4.10.0-SNAPSHOT
Build Number :	
c526922

EAP6.2

How reproducible:
Always

Steps to Reproduce:
1. download CLI client and attached CLI script
2. edit CLI script and provide correct datasouces resource ID
2. ./rhq-cli.sh -s <RHQ IP> -p rhqadmin -u rhqadmin -f <path to test.js>
3. go to EAP->datasources->Inventory->Child history and check result of operation

Actual results:
Operation <Operation{operation='add', address=Address{path: subsystem=datasources,=testDatasource}, additionalProperties={jndi-name=java:jboss/datasources/testDatasource, driver-name=h2, connection-url=jdbc:h2:mem:testDatasource;DB_CLOSE_DELAY=-1}}> returned unparsable JSON, <"JBAS014701: Invalid resource address element '=testDatasource'. The key '' is not valid for an element in a resource address.">., rolled-back=false

Expected results:
Error should clearly show where is the problem. Nobody would guess that previous message is caused by empty plugin configuration.

Additional info:
Another issue is NPE which is thrown when null is passed instead of plugin configuration. Error saying something like 'plugin configuration required' should be thrown instead of just NPE.

Comment 1 Heiko W. Rupp 2014-05-08 14:42:37 UTC
Bump the target version now that 4.11 is out.