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
Summary: [jboss-as-5] type-mapping value for datasources is hard-coded in plug-in desc...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.2
Hardware: All
OS: All
high
high
Target Milestone: ---
: JON 3.0.0,RHQ 4.3.0
Assignee: Stefan Negrea
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon30-sprint8
TreeView+ depends on / blocked
 
Reported: 2011-10-04 22:52 UTC by Larry O'Leary
Modified: 2018-11-14 10:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 791142 0 medium CLOSED EAP 5.1.2 admin console: MySQL type mapping should be present 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Legacy) 64184 0 None None None Never

Internal Links: 791142

Description Larry O'Leary 2011-10-04 22:52:35 UTC
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):
4.2.0

How reproducible:
Always

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 12:27:04 UTC
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 16:27:16 UTC
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 17:01:04 UTC
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 13:25:22 UTC
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 13:39:37 UTC
Created BZ 752431 to implement type mapping validation. This BZ is ready for testing. 

https://bugzilla.redhat.com/show_bug.cgi?id=752431

Comment 7 Mike Foley 2011-11-16 19:29:07 UTC
verified type mapping is a text box.

Comment 8 Mike Foley 2012-02-07 19:25:38 UTC
marking VERIFIED JON 3 bugs to CLOSED/CURRENTRELEASE

Comment 9 Mike Foley 2012-02-07 19:29:58 UTC
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.