While installing a new instance of JBoss AS 5.1 GA consisted of unzipping the zip file into a directory and copying the jdbc driver into the server's lib directory, installing JBoss AS 7.1.1 requires more work. The following steps describes how to install a new instace of JBoss AS 7.1.1 (and 7.1.0), configure the Oracle JDBC driver and set a datasource.
- Download the JBoss AS 7.1.1 from http://www.jboss.org/jbossas/downloads/
- Unzip the archive file to a directory (e.g.: D:\bin\jboss-as-7.1.1.Final)
- set JBOSS_HOME environmental variable to the unzipped directory (e.g.: "D:\bin\jboss-as-7.1.1.Final")
- Run <JBOSS_HOME>/bin/add-user.bat to create an administrator user to be able to log in into the administration interface
- Configure Oracle driver & Datasource:
- Create directory: <JBOSS_HOME>\modules\oracle\jdbc\main
- Download ojdbc6.jar from Oracle (http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html). Note: ojdbc14.jar was not recognized by JBoss 7.1.0 Final.
- Copy ojdbc6.jar into the <JBOSS_HOME>\modules\oracle\jdbc\main
- Create the file module.xml with the following content:
- Edit the <datasource> entry in "
\standalone\configuration\standalone.xml", by adding the followings. (Change the _datasource_name_, _jdbc_conncection_url_, _schema_name_, _password_ strings to match to your environment. The datasource name will be referenced by the your application, e.g.: in the persistence.xml)
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="oracle.jdbc"><resources><resource-root path="ojdbc6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
...
<datasource
jndi-name="java:jboss/datasources/_datasource_name_"
pool-name="_datasource_name_"
enabled="true"
use-java-context="true">
<connection-url>_jdbc_connection_url_</connection-url>
<driver>oracle</driver>
<security>
<user-name>_schema_name_</user-name>
<password>_password_</password>
</security>
</datasource>
<drivers>
<driver name="oracle" module="oracle.jdbc"/>
...
</drivers>
</datasources>
</subsystem>
No comments:
Post a Comment