"WARN At least one MYDS_XA_CONNECTION_PROPERTY_property for datasource MYDS is required. Datasource will not be configured" in JBoss EAP on OpenShift

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) on OpenShift
    • 7
    • 6

Issue

  • Deploying a custom datasource in JBoss EAP on OpenShift

  • During pod startup, encountering a warning:

    WARN At least one MYDS_XA_CONNECTION_PROPERTY_property for datasource MYDS is required. Datasource will not be configured.
    
  • When applications are deployed, they encounter failures related to the datasource

Resolution

  • Specify one or more XA datasource properties in the form <PREFIX>_XA_CONNECTION_PROPERTY_<PROPERTY_NAME>

    # To specify a URL property given DB_SERVICE_PREFIX_MAPPING=ExternalDB2-RAND=MYDS
    MYDS_XA_CONNECTION_PROPERTY_URL=jdbc:oracle:thin:@myhost.myorg.com:1521:oracle
    
  • If the intent is to create a non-XA datasource, set the <PREFIX>_NONXA property explicitly

    MYDS_NONXA=true
    

Root Cause

  • An XA datasource was declared but no XA datasource properties were supplied.

  • When persisted to the standalone-openshift.xml, XA datasource properties appear as in the example for a URL property below:

                    <xa-datasource-property name="URL">jdbc:oracle:thin:@myhost.myorg.com:1521:oracle</xa-datasource-property>
    
  • Note that datasources configured in JBoss EAP on OpenShift are XA, by default, since this is the most common use case given that most applications require multiple resources in each transaction (e.g. a database and a JMS resource).

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.