Running multiple versions of database drivers in JBoss EAP

Solution Verified - Updated -


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


  • We need to use a specific and older version of the Oracle JDBC driver for compliance with one deployed application but we want to use the current version for all other application
  • I tried to run multiple versions of Oracle JDBC drivers in JBoss EAP 6.4.2 following the tutorial on However, the 'slot' is not mentioned in the standalone.xml file when following the above. Could you help me determine the cause of this? In the article you mention there is a problem with this functionality in JBoss prior 6.4.2, but I'm using the latest version
  • How to Configure several oracle drivers in JBoss EAP 6.2?


Please make sure the latest patches are applied

Directions after patching

When creating a module for the driver, you can specify a slot for it
The default slot is main

The below uses Oracle for the examples, but the syntax is the same for other databases.
The commands (other then the module command) are for standalone mode. For domain mode, simply prefix them with /profile=yourprofile

Start the CLI, but do not connect. For domain mode this will need to be done on each host controller.

Install the default driver:

module add --resources=/path/to/ojdbc6_11.2.0.3.jar --dependencies=javax.api,javax.transaction.api

Add a specific version to it's private slot - we're using the slot "appX" to indicate this is used by application X (but the name is free to choose of course)

module add --resources=/path/to/ojdbc6_11. --slot=appX --dependencies=javax.api,javax.transaction.api

For reference, this results in the directory structure:

├── main
│   ├── module.xml
│   └── ojdbc6_11.2.0.3.jar
└── appX
    ├── module.xml
    └── ojdbc6_11.

The module.xml for the "appX" will look like this; note the "slot" attribute:

<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="" slot="appX">
        <resource-root path="ojdbc6_11."/>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>

Next, in the CLI, connect to the standalone instance or to the domain controller.

Register both drivers:

The default one, which will become the "main" slot.


and the specific one, in the "appX" slot


For reference, this results in the XML snippet; note the ":appX" suffix to the "module" attribute

<subsystem xmlns="urn:jboss:domain:datasources:1.1">
      <driver name="oracle" module="">
      <driver name="appX" module="">

When creating datasource, simply specify if you want to use the "oracle" or the "appX" driver.
Details on setting up datasources can be found in How to create a datasource from the JBoss CLI in JBoss EAP 6

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.