Bug 1312405

Summary: EAP7 - unable to create xa datasource - At least one xa-datasource-property is required
Product: [JBoss] JBoss Operations Network Reporter: Filip Brychta <fbrychta>
Component: Plugin -- JBoss EAP 7Assignee: Thomas Segismont <tsegismo>
Status: CLOSED CURRENTRELEASE QA Contact: Hayk Hovsepyan <hhovsepy>
Severity: high Docs Contact:
Priority: high    
Version: JON 3.3.5CC: hhovsepy, loleary, miburman, spinder, tsegismo
Target Milestone: DR01Keywords: Triaged
Target Release: One-off release   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-06 18:57:59 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:
Bug Depends On:    
Bug Blocks: 1314853    

Description Filip Brychta 2016-02-26 15:59:52 UTC
Description of problem:
Creation of new xa datasource fails with WFLYJCA0069: At least one xa-datasource-property is required for an xa-datasource, rolled-back=true

If there is any new required property the JON UI should reflect that.


Version-Release number of selected component (if applicable):
JON3.3.5 with eap plugin pack update03-DR01

How reproducible:
Always

Steps to Reproduce:
1. go to subsystem->Connectors->datasource->Child resources->Create child->xa datasource
2. fill all required properties: {jndi-name:'java:jboss/datasources/testDatasourceXA',driver-name:'h2',xa-datasource-class:'org.h2.jdbcx.JdbcDataSource',*2:[{key:'url',value:'jdbc:h2:mem:testDatasourceXA;DB_CLOSE_DELAY=-1'}


Actual results:
It fails with WFLYJCA0069: At least one xa-datasource-property is required for an xa-datasource, rolled-back=true

Expected results:
All required properties should be marked as required and attempts to submit without all required properties should fail informing user what is missing.

Additional info:
Properties from step 2 work with EAP6 correctly

Comment 1 Michael Burman 2016-02-29 15:15:01 UTC
Is adding XA datasource really working for EAP6 either? This is what we send to the server:

{"operation":"add","address":[{"subsystem":"datasources"},{"xa-data-source":"XATest"}],"driver-name":"h2","flush-strategy":"FailingConnectionOnly","*2":[{"value":"jdbc:h2:mem:testDatasourceXA;DB_CLOSE_DELAY=-1","key":"url"}],"xa-datasource-class":"org.h2.jdbcx.JdbcDataSource","jndi-name":"ava:jboss/datasources/testDatasourceXA"}

Note the "*2" instead of xa-datasource-properties. We don't send that info correctly to EAP6 either. Hmm.

Comment 2 Filip Brychta 2016-02-29 16:08:54 UTC
Yes it is working for EAP6. There is automation for both UI and CLI.
I think that tsegismont will be able to explain "*2"

Comment 3 Michael Burman 2016-03-02 13:45:08 UTC
The problem itself is in DatasourcesComponent doing this:

        CreateResourceDelegate delegate = new CreateResourceDelegate(configDef, getASConnection(), getAddress());
        report = delegate.createResource(report);

There's later on the fix for this "*2" property, but this one misses it.

Comment 4 Thomas Segismont 2016-03-11 15:51:13 UTC
Pull request sent https://github.com/rhq-project/rhq/pull/215

Comment 5 Thomas Segismont 2016-03-11 15:51:29 UTC
(In reply to Thomas Segismont from comment #4)
> Pull request sent https://github.com/rhq-project/rhq/pull/215

EAP7, unlike EAP6, wants xa-datasource-properties to be part of the creation operation.
Same applies to regular datasource.

Comment 6 Thomas Segismont 2016-03-14 14:15:34 UTC
Merged in master

commit e07852abc67546365c1fee94cc3ac9f8369a7a68
Merge: 9066941 f6ae2ef
Author: Michael Burman <yak>
Date:   Mon Mar 14 12:07:39 2016 +0200

Comment 9 Hayk Hovsepyan 2016-03-23 10:58:34 UTC
Verified on jon-plugin-pack-eap-3.3.0.GA-update-03-DR02

XA and Non-XA datasources are able to create.