Getting error installing Oracle Driver JDBC on JBoss EAP for OpenShift using Galleon

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform
    • 4.x
  • Red Hat JBoss EAP for OpenShift
    • jboss-eap74-openjdk11-openshift:7.4.0 or later
  • Galleon layers
    • eap-datasources-galleon-pack:7.4.0.GA-redhat-00003

Issue

  • Getting error installing Oracle Driver JDBC on JBoss EAP for OpenShift using Galleon.
  • Error installing different versions of Oracle Driver JDBC on JBoss EAP for OpenShift using Galleon:

[INFO] -------------< org.jboss.galleon.s2i:layers-provisioning >--------------
[INFO] Building Provision a set of Galleon layers from s2i feature-pack 1.0.0.Final
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- galleon-maven-plugin:4.2.8.Final:provision (wildfly-provisioning-layers jaxrs-server,oracle-driver) @ layers-provisioning ---
[INFO] Downloading from central: https://repo1.maven.org/maven2/com/oracle/ojdbc/ojdbc8/21.6.0.0/ojdbc8-21.6.0.0.jar
[INFO] Downloading from redhat-ga-repository: https://maven.repository.redhat.com/ga/com/oracle/ojdbc/ojdbc8/21.6.0.0/ojdbc8-21.6.0.0.jar
[INFO] Downloading from redhat-ea-repository: https://maven.repository.redhat.com/earlyaccess/all/com/oracle/ojdbc/ojdbc8/21.6.0.0/ojdbc8-21.6.0.0.jar
[INFO] Downloading from jboss-eap-repository: https://maven.repository.redhat.com/techpreview/all/com/oracle/ojdbc/ojdbc8/21.6.0.0/ojdbc8-21.6.0.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.302 s
[INFO] Finished at: 2023-03-02T14:00:38Z
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "openshift" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.jboss.galleon:galleon-maven-plugin:4.2.8.Final:provision (wildfly-provisioning-layers jaxrs-server,oracle-driver) on project layers-provisioning: Provisioning failed: Failed to process JBoss module XML template for feature-pack org.jboss.eap:eap-datasources-galleon-pack:7.4.0.GA-redhat-00003 package com.oracle.ojdbc: Failed to resolve artifact com.oracle.ojdbc:ojdbc8:jar:21.6.0.0: Failed to resolve com.oracle.ojdbc:ojdbc8:jar:21.6.0.0: Could not find artifact com.oracle.ojdbc:ojdbc8:jar:21.6.0.0 in central (https://repo1.maven.org/maven2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jboss.galleon:galleon-maven-plugin:4.2.8.Final:provision (wildfly-provisioning-layers jaxrs-server,oracle-driver) on project layers-provisioning: Provisioning failed

Resolution

Disclaimer: Red Hat does not support the JDBC drivers. It only provides integration with them.

There is currently no definitive solution to this problem. The Jira ticket This content is not included.JBEAP-24620 is opened to handle this. As a workaround, use the ojdbc8 19.3.0.0 version of the Oracle JDBC Drivers, as follows:

        - name: GALLEON_PROVISION_FEATURE_PACKS
          value: 'org.jboss.eap:eap-datasources-galleon-pack:7.4.0.GA-redhat-00003'
        - name: ORACLE_DRIVER_VERSION
          value: 19.3.0.0

To use a different Oracle Driver JDBC version, the JBoss EAP 8 image might be used, as follows:

        - name: GALLEON_PROVISION_FEATURE_PACKS
          value: 'org.jboss.eap:eap-datasources-galleon-pack:8.0.0.Beta1-redhat-00005'
        - name: ORACLE_DRIVER_VERSION
          value: 21.6.0.0

Root Cause

In the process of building the image, the package eap-datasources-galleon-pack:7.4.0.GA-redhat-00003 is configured to fetch the artifact from https://repo1.maven.org/maven2/com/oracle/ojdbc/ojdbc8/
com.oracle.ojdbc, but this address only has a single Oracle JDBC Driver version available 19.3.0.0.
This content is not included.JBEAP-24620 addressed the limitation of only one oracle driver and aims to allow user to configure the GroupId/artifactId of the driver.

Components

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.