How to install a database driver on JBoss EAP 6 or JBoss AS 7



This tutorial describes how to install a database driver on a JBoss EAP 6 or JBoss AS 7 Application Server.

1. Installation
In this document {JBOSS_HOME} refers to the root folder of the JBoss Application Server installation.

First create a module

  1. Go to {JBOSS_HOME}\modules.
  2. Create following directory structure.
  3. JBOSS_HOME}\modules\com\oracle\ojdbc6\main (the “main” as last folder is crucial!)
  4. In that folder put the oracle jdbc jar. For example ojdbc6-11.2.0.3.jar.
  5. In the same folder create a file module.xml
  6. Add this content to the file:

– The name in line 2) “com.oracle.ojdbc6” must match the directory structure created in step 2.
(omit the “main” part).
– In line 4) the resource-root path must point to the jar file in the main folder.

2. Next install the database driver module

    If JBoss AS used in Standalone mode:

  1. Go to {JBOSS_HOME}\standalone\configuration\standalone.xml
  2. Find the node <subsystem xmlns=”urn:jboss:domain:datasources:1.0“> <datasources> <drivers> in the drivers node, add this content:

    If JBoss AS used in Domain mode:

  1. Go to {JBOSS_HOME}\domain\configuration\domain.xml
  2. The next steps are the same as in Standalone mode.

3. Start or Restart the JBoss Application Server

Start or restart the JBoss AS to apply the changes.
Check the log for this message:

This means the driver is loaded. If you do not see this message, check that the directory structure is correct ( with “main” as final sub folder ) and check the content of the module.xml ( check line 2 and 4 as mentioned before).

You can now create data sources based on this database driver.