Bug 1066108 - [eap6] Confusing error message when empty plugin configuration is passed during creation of new datasource via CLI
Summary: [eap6] Confusing error message when empty plugin configuration is passed duri...
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 4.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: RHQ 4.13
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-17 17:35 UTC by Filip Brychta
Modified: 2022-03-31 04:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)
cli script (1.40 KB, application/javascript)
2014-02-17 17:35 UTC, Filip Brychta
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.