# Guide to OpenIG
Chapter 5. Configuring Deployment Containers

Sidebar | Prev | Up | Next

## 5.3. JBoss

JBoss reference links:

- JBOSS 5 Documentation

- JBOSS 6 Documentation

- Admin Console Quick Start Guide

Download and install Sun Java SE JDK 6 Update 21 or later. At this time these are the only versions of any JDK supported with OpenIG.

Download and install the community version of JBoss 5.1. $JBOSS_HOME refers to the location you have installed JBoss. The assumption in this chapter is that you run the default server configuration.

Configure JBoss to listen on the same port and protocol of the application you are protecting with OpenIG. If your application listens on both an HTTP and an HTTPS port you must configure JBoss to do so as well. If you are installing to run the samples you do not have to modify the JBoss port configuration since both the Joss default and the samples use port 8080.

To configure JBoss to use a port other than 8080 modify `server.xml` under your server configuration. For example, if you are using the default server configuration, `server.xml` is `$JBOSS_HOME/server/default/deploy/jbossweb.sar/server.xml`. The quickest way to do this is to search for the default value of 8080 and replace it with the new port number.

If OpenIG accesses an SQL database you must configure JBoss for JNDI. Once you have JBOSS configured you must add the jar for the database, and set up a JNDI data source and a reference to that data source in your web application. The following steps are for the MySQL Connector/J.

Download the MySQL JDBC Driver Connector/J Add it to the JBoss class path by copying it to `$JBOSS_HOME/server/default/lib`.

Add a JNDI data source for your MySQL server and database in `$JBOSS_HOME/server/default/deploy/mysql-ds.xml`.

    <datasources>
      <local-tx-datasource>
        <jndi-name>jdbc/forgerock<jndi-name>
        <connection-url>jdbc:mysql://localhost:3306/databasename<connection-url>
        <driver-class>com.mysql.jdbc.Driver<driver-class>
        <user-name>admin<user-name>
        <password>11111111<password>
        <min-pool-size>5<min-pool-size>
        <max-pool-size>20<max-pool-size>
        <idle-timeout-minutes>5<idle-timeout-minutes>
        <exception-sorter-class-name>
    com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter
        <exception-sorter-class-name>
        <valid-connection-checker-class-name>
    com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker
        <valid-connection-checker-class-name>
      <local-tx-datasource>
    <datasources>

Add a resource reference to the data source in `$JBOSS_HOME/server/default/deployers/jbossweb.deployer/web.xml`.

    <resource-ref>
        <description>MySQL Connection<description>
        <res-ref-name>jdbc/forgerock<res-ref-name>
        <res-type>javax.sql.DataSource<res-type>
        <res-auth>Container<res-auth>
    <resource-ref>