Skip Headers
Oracle® Application Server TopLink Application Developer's Guide
10g Release 2 (10.1.2)
Part No. B15901-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Non-CMP Configuration

OracleAS TopLink supports several architectures that leverage a J2EE container. To enable OracleAS TopLink in these architectures configure the following:

Classpath

Place the OracleAS TopLink JARs on the application server classpath. Classpath configuration is container-specific. For more information, see:

Datasource

OracleAS TopLink applications that run in a J2EE container often use a J2EE Datasource to access JDBC connections. To leverage a J2EE datasource, configure a datasource with the server's configuration tools, and specify the name of the datasource in the sessions.xml file, as follows:

    <login>
        <datasource>java:comp/env/jdbc/myJTADataSource</datasource>
        <uses-external-connection-pool>true</uses-external-connection-pool>
        ...
    </login> 

JTA integration

The OracleAS TopLink Unit of Work uses the Java Transaction API (JTA) to participate in global transactions. Configure OracleAS TopLink JTA support in the sessions.xml file as follows:

    <login>
        ...
        <uses-external-transaction-controller>true</uses-external-transaction-controller>
    </login>
    <external-transaction-controller-class>
        oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController     </external-transaction-controller-class>

OracleAS TopLink support for external transaction controllers requires a J2EE datasource. OracleAS TopLink provides several container-specific external transaction controllers, as well as a generic controller.

For more information, see "J2EE Integration".

Oracle Application Server Containers for J2EE (OC4J) Support

To configure OracleAS TopLink support for OC4J, include the following OracleAS TopLink JARS on the OC4J classpath:

<ORACLE_HOME>\toplink\jlib\toplink.jar
<ORACLE_HOME>\toplink\jlib\antlr.jar

For example, add the following code to the OC4J application.xml file:

<library path="/OraHome1/toplink/jlib/toplink.jar" />
<library path="/OraHome1/toplink/jlib/antlr.jar" />

Substitute your <ORACLE_HOME> directory for OraHome1.

IBM WebSphere Application Server 4.0

OracleAS TopLink provides support for IBM WebSphere Application Server 4.0. To configure this support for IBM WebSphere Application Server, copy the following OracleAS TopLink JARs to the application server classpath directory:

<ORACLE_HOME>\toplink\jlib\toplink.jar
<ORACLE_HOME>\toplink\jlib\antlr.jar
<ORACLE_HOME>\lib\xmlparserv2.jar

Table B-1 lists the default application classpath directories for IBM container components.

Table B-1 Classpath Directories for IBM Container Components

Container Default Application Classpath
WebSphere Application Server 4.0 (for Windows) \WebSphere\AppServer\lib\app
WebSphere Studio Application Developer 4.0 (for Windows) \Program Files\ibm\Application Developer\plugins\com.ibm.etools.websphere.runtime\lib\app

Configuring IBM WebSphere Module Visibility Setting

Because of the way the in which WebSphere defines its class loader isolation mode, OracleAS TopLink supports only the APPLICATION and MODULE modes for module visibility.

Module Mode

A J2EE application (EAR file) can have multiple EJB modules (EJB JAR files). OracleAS TopLink CMP loads one toplink-ejb-jar.xml per EJB module (EJB JAR). If you do not set the loader isolation mode to MODULE, then an EJB module can load the incorrect toplink-ejb-jar.xml from another EJB module.

Application Mode

OracleAS TopLink supports class loader isolation APPLICATION mode. However, each application must have only one EJB JAR file.

For more information about the module visibility in IBM WebSphere, see the IBM WebSphere documentation.

Table B-2 lists the application and module modes OracleAS TopLink supports.

Table B-2 OracleAS TopLink Support of Server-Installable Applications on Server Versus Module Visibility Mode

Installable Applications on Server Application Module Compatibility Server
Multiple applications in which each application can have multiple OracleAS TopLink EJB modules No Yes No No
Multiple applications in which each application has single OracleAS TopLink EJB module Yes Yes No No
Single application has multiple OracleAS TopLink EJB modules No Yes No No
Single application has Single OracleAS TopLink EJB module Yes Yes Yes Yes

IBM WebSphere Application Server 5.0 and 5.1

To enable OracleAS TopLink support for IBM WebSphere Application Server 5.0 and 5.1, configure the following for WebSphere at the Enterprise Application level:

Creating a Shared Library

Create a shared library that contains the following Toplink JARS, and associate the shared library with the application:

<ORACLE_HOME>\toplink\jlib\toplink.jar
<ORACLE_HOME>\toplink\jlib\antlr.jar
<ORACLE_HOME>\lib\xmlparserv2.jar

Class Loader Mode

When using OracleAS TopLink with WebSphere Application Server 5.0.2 and 5.1, Oracle recommends that applications be configured and deployed with their class loader mode set to PARENT_LAST. To configure an application with its class loader mode set to PARENT_LAST, select one of the following options:

  • Remove (or rename) the <JAVA_HOME>\lib\jaxp.properties file, where <JAVA_HOME> is typically <WebShpere_Install>\java\jre.

  • Place the xerces library included in the WebSphere installation after xmlparserv2.jar in the same shared library. This file is located in <WebShpere_Install>\java\jre\lib\xml.jar.

Note that you can also configure the class loader at the server level.

For more information, see the IBM WebSphere 5.0 documentation.

Application Class Loader Policy

Set the Application class loader Policy on the application server to Multiple.

For more information, see the IBM WebSphere 5.0 documentation.

A WAS 5.0 JTA Integration Class

For applications that require JTA integration, specify the external transaction controller in the OracleAS TopLink sessions.xml file. To enable the WebSphere 5.0 external transaction controller, add the following line to the sessions.xml file:

<external-transaction-controller-class>oracle.toplink.jts.was.
JTSExternalTransactionController_5_0</external-transaction-controller-class>

For more information, see "External Transaction Controllers".

BEA WebLogic Application Server (6.1, 7.0, or 8.1)

OracleAS TopLink provides support for BEA WebLogic Application Server 6.1, 7.0 and 8.1. This support requires manual configuration, and includes a sample domain and the ability to use a security manager with BEA WebLogic.

To configure OracleAS TopLink support for BEA WebLogic Server, add the following JAR files to the application server classpath:

<ORACLE_HOME>\toplink\jlib\toplink.jar
<ORACLE_HOME>\lib\xmlparserv2.jar

Note:

When you add the toplink.jar and xmlparserv2.jar files in the application server classpath, ensure they are placed before the weblogic.jar file.

Using a Security Manager with BEA WebLogic Server

If you use a security manager, specify a security policy file in the weblogic.policy file (normally located in the BEA WebLogic install directory), as follows:

-Djava.security.manager
-Djava.security.policy==c:\weblogic\weblogic.policy

The BEA WebLogic installation procedure includes a sample security policy file. You must edit the weblogic.policy file to grant permission for OracleAS TopLink to use reflection.

Example B-1 A Subset of a ÒGrantÓ Section from a BEA WebLogic.policy File

This example illustrates only the permissions that OracleAS TopLink requires, but most weblogic.policy files contain more permissions than are shown in this example.

grant {
// "enableSubstitution" required to run the WebLogic console
permission java.io.SerializablePermission "enableSubstitution";
// "modifyThreadGroup" required to run the WebLogic Server
permission java.lang.RuntimePermission "modifyThreadGroup";
//grant permission for OracleAS TopLink to use reflection
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};