0

I'm using Jboss EAP 7.1 now, recently I add the Oracle datasource to the server as the datasource I correctly configured before. But I got the error message:

Services with missing/unavailable dependencies" => [ "org.wildfly.data-source.CreditDS is missing [jboss.jdbc-driver.oracle11g]"

CreditDs is my JNDI name and oracle11g is the driver name. Here are my configuration:

<!-- standalone.xml -->
<datasource jndi-name="java:jboss/datasources/CreditDS" pool-name="CreditDS" enabled="true">
    <connection-url>jdbc:oracle:thin:@***</connection-url>
    <driver>oracle11g</driver>
    …… …… ……
</datasource>
<drivers>
<driver name="oracle11g" module="com.oracle.ojdbc14">
    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>

Here is the modules.xml in modules/com/oracle/ojdbc14/main

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc14">
    <resources>
        <resource-root path="ojdbc14-10.2.0.4.0.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

What's wrong?

Germinate
  • 2,008
  • 2
  • 14
  • 23

1 Answers1

0

I guess your oracle module is not recognized correctly.

The procedure for adding oracle JDBC module is as follows:

1 create folder com/oracle/ojdbc14/10.2.0.4.0 withing JBOSS_HOME/modules directory
2 copy your oracle jar file to the folder and add a module.xml with the following contents

 <?xml version="1.0" encoding="UTF-8"?>
 <module xmlns="urn:jboss:module:1.3" name="com.oracle.ojdbc14" slot="10.2.0.4.0">
   <resources>
     <resource-root path="ojdbc14-10.2.0.4.0.jar"/>
   </resources>
   <dependencies>
     <module name="javax.api"/>
     <module name="javax.transaction.api"/>
   </dependencies>
 </module>

3 Create driver definition in standalone.xml

 <driver name="oracle14" module="com.oracle.ojdbc14:10.2.0.4.0">
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
 </driver>

Couple of things to note:

Do pay attention to correct version of JBoss modules XMLNS - you tagged your questions with EAP7 - so you should use xmlns 1.3.
Note the slot value in both modules.xml and driver definition. This could be any value, but it is a good practice to use the lib version.
After adding any modules into JBoss, you need to restart it completely(restart JVM).
Lastly, you should use an up-to-date version of Oracle JDBC driver as ojdbc14 are not supported anymore, so it should be like this:

Module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.oracle.ojdbc7" slot="12.1.0.2">
<resources>
  <resource-root path="ojdbc7-12.1.0.2.jar"/>
</resources>

<dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
</dependencies>

Folder modules/com/oracle/ojdbc7/12.1.0.2

Driver:

<driver name="oracle7" module="com.oracle.ojdbc7:12.1.0.2">
   <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
yntelectual
  • 3,028
  • 18
  • 24
  • Thanks! I follow your steps but still not work. I saw this https://stackoverflow.com/questions/33110412/wildfly-10-failing-to-load-mysql-xa-driver-on-startup as reference, use the jboss-cli to add the driver, and it works fine. A strange problem, don't know why. – Germinate Mar 28 '18 at 02:18