JBoss Wildfly 14 – Java 11 – how to add / configure a datasource Oracle 11G

How to setup the oracle driver or add a datasource oracle in your server jboss wildfly ? here , in the following lines, you can find an example of configuration you can apply :

Module configuration

In your directory

add this 2 file :

1) the jar ojdbc7.jar from oracle.

2) create a file module.xml with this content :


<module xmlns= »urn:jboss:module:1.1″ name= »com.oracle »>
<resource-root path= »ojdbc7.jar »/>
<module name= »javax.api »/>
<module name= »javax.transaction.api »/>


Update standalone.xml

Assuming you are using the standalone mode, update the file standalone.xml in the directory :

After the tag <\extensions> add the following line :

<path name= »oraclejar » path= »mypathtowilfly\wildfly-14.0.1.Final\modules\system\layers\base\com\oracle\main »/<
</paths>example :
<path name= »oraclejar » path= »D:\Server\wildfly-14.0.1.Final\wildfly-14.0.1.Final\modules\system\layers\base\com\oracle\main »/<

In the part <subsystem xmlns= »urn:jboss:domain:datasources:5.0″> and inside the tag <datasources> , add the following lines :


<datasource jndi-name= »java:jboss/datasources/OracleDS » pool-name= »OracleDS » enabled= »true »>

don’t forget to modify the term IPofYourServer with your own server IP where you host the oracle database and to update the user name [your-database-user] and the password of the database user [your-database-password]

and inside the tag <drivers> :


<driver name= »oracle » module= »com.oracle »>

Find the line : <subsystem xmlns= »urn:jboss:domain:ee:4.0″>

and add under the following lines :

<module name= »com.oracle »/>

Tips : in case you have a port conflict when running jboss on the port 8080 with the oracle database, you can change the port in the standalone.xml file , find the line <socket-binding-group

and edit the following line, by example if you want set up the port to 8081 :

<socket-binding name= »http » port= »${jboss.http.port:8081} »/>

This article contain affiliate links.

Laisser un commentaire