Oracle9iAS TopLink CMP for Users of IBM WebSphere Guide Release 2 (9.0.3) Part Number B10067-01 |
|
This chapter describes the configuration and testing of TopLink Container-Managed Persistence. Please refer to Oracle9iAS TopLink Getting Started for installation information.
TopLink Container-Managed Persistence requires:
java.exe
or jre.exe)
TopLink only supports the WebSphere APPLICATION mode and MODULE mode for module visibility. This is because of the way WebSphere Application Server defines its class loader isolation mode for each setting.
A J2EE application (EAR file) can have multiple EJB modules (EJB JAR files). TopLink Container-Managed Persistence is designed to load one toplink-ejb-jar.xml
per EJB module (EJB JAR). If the module visibility mode is not set to MODULE, an EJB module could load the wrong toplink-ejb-jar.xml
from the other EJB module. TopLink CMP also supports the application with the restriction that each application can only have one EJB JAR file. Again, this is due to how class loader is designed for this mode. For more information about module visibility in WebSphere, consult the WebSphere documentation.
WebSphere 4.0 document from the link above indicates, "Portable J2EE applications should be written with Module-level visibility." Developer should keep this in mind when developing application.
The following procedures configure TopLink Container-Managed Persistence Foundation Library. This procedure assumes you have already installed TopLink Container-Managed Persistence.
The steps required for preparing a system for TopLink depends on the type of system you are running:
<WEBSPHERE_INSTALL_DIR>\lib\app
If you are using WebSphere, (the default installation directory is C:\WebSphere\AppServer
) ; if you are using WSAD, the default directory is C:\Program Files\ibm\Application Developer\plugins\com.ibm.etools.websphere.runtime
.
<INSTALL_DIR>
\core\lib\toplink.jar
<INSTALL_DIR>
\core\lib\xerces.ja
r
<INSTALL_DIR>
\core\lib\tl_wasx.jar
<INSTALL_DIR>
\hsql\lib\hsql_ds.jar
<INSTALL_DIR>
\hsql\lib\hsqldb.jar
where <INSTALL_DIR>
is the directory into which you installed TopLink (C:\{ORACLE_HOME}\toplink
if you installed to the default directory).
<JAVADIR>\bin
where <JAVADIR>
is the installation drive and directory for your Java Virtual Machine (VM) executable. This path must be the first one listed in the PATH environment variable, before any other paths.
<JAVADIR>\bin\;
as the first entry in the PATH list.
<INSTALL_DIR>\core\lib\toplink.jar;<INSTALL_DIR>
\core\lib\xerces.jar;<INSTALL_DIR>
\was_cmp\lib\tl_wasx.jar;<INSTALL_DIR>
\hsql\lib\hsqlds.jar;<INSTALL_DIR>
\hsql\lib\hsqldb.jar
where <INSTALL_DIR>
is the directory into which you installed TopLink (C:\{ORACLE_HOME}\toplink
if you installed to the default directory).
Compile and execute the JDBCConnectTest
class in the oracle.toplink.tutorials.gettingstarted
package.
JDBCConnectTest
class from the command line, passing appropriate database login information as parameters as follows:
java oracle.toplink.tutorials.gettingstarted.JDBCConnectTest <username> <password> <database url> <jdbc driver class>
or
main()
method to contain appropriate database login information as parameters, then recompile and execute the class. For example:
public static void main(String[] args) { JDBCConnectTest test = new JDBCConnectTest(); if (args.length > 0) { test.connect(args[0], args[1], args[2], args[3]); } // Add your login information below else { /*This test uses the WebSphere sql server driver. Any compliant jdbc driver can be used. Do not use WebSphere pool devices for this test.*/ test.connect("<user>","<password>", "WebSphere.jdbc.mssqlserver4.Driver", "jdbc:WebSphere:mssqlserver4:myserver:1433"); } }
If the code does not run successfully, check the error message and ensure that all of your settings are correct. You may also need to consult Oracle9iAS TopLink Troubleshooting.
With the Java VM PATH and CLASSPATH properly configured, run the following classes to test the deployment tool:
java oracle.toplink.ejb.cmp.was.deploy.Deploy
java oracle.toplink.ejb.cmp.was.deploy.EJBDeployFrame(GUI tool)
Other ways to test the installation:
To test TopLink Container-Managed Persistence with entity beans, run the Single Bean example documented in Chapter 8, "The Single Bean Example Application". .
When the TopLinkConnectTest
, the TopLink Mapping Workbench, and the Single Bean example all run successfully, your TopLink installation is complete.
Start the server as described in the WebSphere documentation. Refer to the WebSphere documentation for more information on class loader and classpath issues. Once the server is running, start the TopLink CMP application.
See Oracle9iAS TopLink Troubleshooting for more information.
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|