Oracle ATG Web Commerce applications running on JBoss use a JTDataSource
component, which should be configured to point to a JNDI reference to a DataSource
component running in JBoss.
Note: The Configuration and Installation Manager (CIM) utility makes these configurations for you. See Configuration and Installation Manager (CIM).
Where to Configure JBoss Data Sources
You should configure your data source in the localconfig
, jbossconfig
, or equivalent named configuration layer. See “Managing Properties Files” in the ATG Platform Programming Guide for information on application-server-specific and named configuration layers.
In order to use the jbossconfig
directory:
Modify the
MANIFEST.MF
file for the given Oracle ATG Web Commerce module to include the following property:
ATG-JbossConfig-Path: jbossconfig
Create a
jbossconfig
directory and put the properties files there.
Note: If JBoss configuration files are stored in the ATG-3rdPartyConfig-Path
layer, you might see errors if you start up applications on other application servers, because the datasources are configured to point to JNDI names that are not set up on that application server. Datasource configuration files that are specific to JBoss should be in the ATG-JBossConfig-Path
rather than the ATG-3rdPartyConfig-Path
of those data source configurations.
Configuring New JBoss Datasources
To configure a new data source, go to the <JBdir>\server\
server_name
\deploy\atg-ds.xml
file. Edit the following configuration settings:
JNDI name
URL
driver class
username
password
transaction isolation level
connection pool numbers
See your application server documentation for information on the available parameters. For example:
<?xml version="1.0" encoding="UTF-8"?> <datasources> <xa-datasource> <jndi-name>atgcore_ds</jndi-name> <track-connection-by-tx>false</track-connection-by-tx> <isSameRM-override-value>false</isSameRM-override-value> <min-pool-size>5</min-pool-size> <max-pool-size>100</max-pool-size> <blocking-timeout-millis>5000</blocking-timeout-millis> <idle-timeout-minutes>15</idle-timeout-minutes> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction- isolation> <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa- datasource-class> <xa-datasource-property name="URL">jdbc:oracle:thin:@myserver:1521:ora10r2</xa-datasource- property> <xa-datasource-property name="User">username</xa-datasource-property> <xa-datasource-property name="Password">password</xa-datasource-property> <!-- Uncomment the following if you are using Oracle 9i <xa-datasource-property name="oracle.jdbc.V8Compatible">true</xa- datasource-property> --> <exception-sorter-class-name> org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter </exception-sorter-class-name> </xa-datasource> </datasources>
Note: Entering passwords in clear text files entails some security risks. Take steps to secure files that contain clear text passwords.
If you have changed the JNDI name, you must also change the name configured in the <ATG10dir>/home/localconfig/atg/dynamo/service/jdbc/JTDataSource.properties
file:
$class=atg.nucleus.JNDIReference
JNDIName=JNDIDataSourceName
For example, java:/ATGOracleDS
.
Note that if you are using a WatcherDataSource
, this would be configured instead in a DirectJTDataSource.properties
file.
Adding Database Class Files
If your database driver is located anywhere other than the server’s lib directory (for example, C:\jboss\jboss-eap-5.1.0\jboss-as\server\
atg_server
\lib
), you must edit <JBdir>/bin/run.sh|bat
and add your database class files, such as Oracle’s ojdbc6.jar
, to the JBoss classpath. To do this, search for $JBOSS_CLASSPATH
and just above it, create a line:
JBOSS_CLASSPATH=path_to_
ojdbc6.jar
Rebuild and redeploy your EAR file.