Sunday, October 6, 2013

How to deploy jdbc driver as a module in JBoss AS7

When multiple applications are using the same jdbc driver in an JBoss AS7, it is good to deploy the jdbc driver as a module instead of deploying the jdbc driver in every applications.

or we need to create JNDI datasource connection in JBoss AS7, then it is a must to deploy the jdbc driver into JBoss AS7, else JBoss AS7 is unable to create database connection to the target DB.

1. create folder in <JBoss_AS7_installation_folder>/modules
    eg, oracle

2. put the ojdbc14.jar (the oracle jdbc driver) in the main folder

3. create module.xml in main with the following content
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="">
        <resource-root path="ojdbc14.jar"/>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>

4. create jdbc driver entry in standalone.xml
    a) open <JBoss_AS7_installation_folder>/standalone/configuration/standalone.xml
    b) search for <drivers>
    c) add the following content between <drivers>...</drivers>
<driver name="oracle" module="">

5. start JBoss AS7
    if ojdbc14.jar.index generated in <JBoss_AS7_installation_folder>/modules/com/oracle/ojdbc14/main,
    that's mean the oracle jdbc driver is successfully deployed as a module in JBoss AS7.

6. Create JNDI datasource in JBoss AS7.



  1. I couldnt find the oracle driver
    Only h2 is available when I tried to
    Create data source
    Thank you

    1. Please check to add driver to jboss



Related Posts Plugin for WordPress, Blogger...