Getting New missing/unsatisfied dependencies when using non JDBC 4 compliant JDBC driver with EAP 6

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Issue

  • When a DataSource is configured with Oracle JDBC Driver ojdbc14.jar, facing the following "missing/unsatisfied dependencies" message during the JBoss EAP 6 start-up:
INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
       service jboss.jdbc-driver.oracle (missing) dependents: [service jboss.data-source.java:/OracleDS] 

ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.0.0.GA (AS 7.1.2.Final-redhat-1) started (with errors) in 12611ms - Started 136 of 276 services (2 services failed or missing dependencies, 136 services are passive or on-demand)
  • Database driver deployed perfectly and able to create the datasource using ojdbc14.jar but unable to display in the driver list. How to resolve this issue?

  • Getting the following error while Configuring the DataSource on jboss eap-6:

JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.oracle (missing) dependents: [service jboss.data-source.java:/OracleDS, service jboss.driver-demander.java:/OracleDS]
  • I have created a module and modified standalone.xml but it is not registering oracle database.

Resolution

Important: ojdbc14.jar is meant to be used with Java 1.4.x and is generally not advisable. Instead use ojdbc6.jar when using Java 1.6 or use Content from www.oracle.com is not included.ojdbc7.jar when using Java 1.7 .

Any JDBC 4 compliant driver will automatically be recognized and installed into the system by name and version by Java service provider mechanism. JDBC 4 compliant drivers have a text file named META-INF/services/java.sql.Driver, which contains the name of the class(es) of the JDBC Drivers, in that JAR. However, non JDBC 4 compliant driver JARs do not contain a META-INF/services/java.sql.Driver file. So it needs some modification to be made deployable.

For instance, Oracle JDBC Driver ojdbc14.jar is not JDBC 4 compliant driver. So you have to choose either

or

  • Modify ojdbc14.jar to add the missing file by the following steps if you need to use non JDBC 4 compliant JDBC driver.
  1. Change to, or create, an empty temporary directory

  2. Create a META-INF subdirectory

  3. Create a META-INF/services subdirectory

  4. Create a META-INF/services/java.sql.Driver file which just contains one line, the fully-qualified class name of the JDBC driver, like the following:

     oracle.jdbc.OracleDriver
    
  5. Use the following jar command-line tool to update the JAR like this:

     jar -uf ojdbc14.jar META-INF/services/java.sql.Driver
    

Then, the ojdbc14.jar has the following directory structure:

ojdbc14.jar
├── META-INF
│   ├── MANIFEST.MF
│   └── services
│       └── java.sql.Driver
└── oracle
    ├── ...
    └── ...

Note: According to EAP 6 Supported Configurations page, fully tested Oracle JDBC Driver is "Oracle JDBC Driver v11".

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.