If you want Magnolia to use an external database, such as, Oracle, MySQL, Postgres, etc. with a JNDI connection then you are going to want to create a module for your JBDC driver. I suggest doing this prior to Magnolia installation.
Steps
- Create a file path structure under the
JBOSS_HOME
/modules/JBOSS
- Copy the JDBC driver JAR into the
main/
subdirectory. In the
main/
subdirectory, create amodule.
xml
file:<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="com.oracle"> <resources> <resource-root path="ojdbc7.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.transaction.api"/> </dependencies> </module>
The directory should look like this:
- Start the Server:
JBOSS
- Start the Management CLI in another command window:
JBOSS_HOME/bin/jboss-cli.sh --connect controller=localhost:9999
- Run the following CLI command to add the JDBC driver module as a driver:
/subsystem=datasources/jdbc-driver=DRIVER_NAME:add(driver-name=DRIVER_NAME,driver-module-name=MODULE_NAME,driver-xa-datasource-class-name=XA_DATASOURCE_CLASS_NAME)