Bug 743437 - [jboss-as-5] type-mapping value for datasources is hard-coded in plug-in descriptor resulting in unsupported datasource resource configuration in RHQ
[jboss-as-5] type-mapping value for datasources is hard-coded in plug-in desc...
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
All All
high Severity high (vote)
: ---
: JON 3.0.0,RHQ 4.3.0
Assigned To: Stefan Negrea
Mike Foley
Depends On:
Blocks: jon30-sprint8
  Show dependency treegraph
Reported: 2011-10-04 18:52 EDT by Larry O'Leary
Modified: 2012-02-16 10:13 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Legacy) 64184 None None None Never

  None (edit)
Description Larry O'Leary 2011-10-04 18:52:35 EDT
Description of problem:
When using a custom JCA type-mapping, RHQ fails to display the correct value when viewing the datasource configuration. When a custom type-mapping is selected (as defined in conf/standardjbosscmp-jdbc.xml) the RHQ UI displays Cloudscape as the type-mapping. This is wrong. Reviewing the *-ds.xml deployed in the JBoss AS instance type-mapping is set to the custom value of Oracle10g -- a user defined mapping. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Add a custom/user-defined mapping to conf/standardjbosscmp-jdbc.xml (the Oracle9i type-mapping can be used as the base) to a JBoss AS 5 install
2. Configure DefaultDS in a JBoss AS 5 instance to use a type-mapping of Oracle10g (the custom mapping defined above)
3. Confirm the datasource is functioning
4. Add the AS instance which contains the modified DefaultDS to RHQ inventory
5. Navigate to the datasource resource's Configuration tab
6. Review DefaultDS' Configuration tab under Advanced / Metadata / Type Mapping
Actual results:
Type Mapping will display Cloudscape

Expected results:
Type Mapping should display Oracle10g

Additional info:
This is because the property Type Mapping (as defined in multiple places of the jboss-as-5 and jboss-as plug-ins) contain a hard-coded list of available mapping instead of reading them from conf/standardjbosscmp-jdbc.xml.

If we can not dynamically determine the available type mappings, we should make this a text entry field allowing the value defined in the descriptor to be used or a custom value be entered.
Comment 1 Charles Crouch 2011-10-18 08:27:04 EDT
Making the type mappings dynamic is beyond the scope of JON3.0
We should look to determine how much effort, and any backward compatibility 
issues for existing resources in inventory there might be, to solve this by 
turning the field into which accepts free form text. This change should also 
not impose any burden on users creating new Datasources, they shouldn't have to 
type this info in.
Comment 2 Stefan Negrea 2011-11-04 12:27:16 EDT
The reported problem does not affect JBoss AS4 plugin; Type Mapping property for that plugin is a text field. 

This BZ is applicable only to JBoss AS5 plugin. There are two instances where the Type Mapping occurs; Advanced -> Metadata -> Type Mapping and Advanced -> Type Mapping.

The best solution to fix this issue is to dynamically generate the list of options from the conf file. However, as a downside the file would need to be scanned frequently to pick up changes made outside of RHQ. There is no support for this kind of functionality in RHQ right now.

The second best solution is to have a set of predefined options and to allow users to add custom values to that list. However, the implementation is quiet complex because lack of support in the current domain and UI implementation (... and parsing of plugin descriptors). 

The third solution would be to transform the field into a text box. This is the only option available today. 

I updated the code to display a textbox for Type Mapping configuration. The field will be pre-populated by the plugin on a best effort case. Afterwards, the textbox will accept any value so the user can update to the desired value.
Comment 3 Ian Springer 2011-11-04 13:01:04 EDT
Now that the field is a regular text box and allows any value, we ideally should do validation of the value in the plugin's impl of updateResourceConfiguration() and set an error on the PropertySimple if it's not a valid type mapping name.

We'd have to see if it's possible to retrieve the list of valid type mapping names from the profile service. If so, this would be a fairly easy change. If not, and we had to use JMX or manual XML file access, it could be more involved.
Comment 4 Stefan Negrea 2011-11-09 08:25:22 EST
I added the list of default type mappings in the description of the property. The users can now just copy and paste any of the values that get distributed with AS5.
Comment 5 Stefan Negrea 2011-11-09 08:39:37 EST
Created BZ 752431 to implement type mapping validation. This BZ is ready for testing. 

Comment 7 Mike Foley 2011-11-16 14:29:07 EST
verified type mapping is a text box.
Comment 8 Mike Foley 2012-02-07 14:25:38 EST
Comment 9 Mike Foley 2012-02-07 14:29:58 EST
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE

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