Thursday, June 9, 2011

How to Change and Verify CLASSPATH Settings for the Concurrent Manager

How to Change and Verify CLASSPATH Settings for the Concurrent Manager [ID 178766.1]
Modified 07-FEB-2011 Type HOWTO Status PUBLISHED
In this Document
Goal
Solution

Applies to:

Oracle Marketing
Information in this document applies to any platform.
Goal

This document is describing how to change the CLASSPATH variable so that Concurrent Requests will use it properly and also how to verify what is the value of CLASSPATH for a particular concurrent request.
Solution

1. Description of the CLASSPATH environment variable and the ways it can be used.

The CLASSPATH, being an environment variable, will differ depending on the environment, meaning the runtime environment of a particular process.

For example, if the CLASSPATH was set directly in a UNIX shell, then that would be the CLASSPATH echo'ed back within that shell and within any shell forked from that shell.

However, if CLASSPATH is set in a shell script file, then only processes running from within the context of that script will have that CLASSPATH.

In the Oracle Apps, there are a number of different runtime contexts.
One is the Apache - JServ - JSP engine which has it's CLASSPATH set in a file (usually jservctl, sometimes jserv.properties)

Another context is the Concurrent Manager where all Concurrent Processes are run. There is a separate script for running these, being as they are "concurrent" to the HTML stack. The script that starts up the Concurrent Manager is either adovars.env or some other file that calls adovars.env.
The adovars.env file has a separate setting of the CLASSPATH, since there may be different runtime requirements for Java classes for Concurrent Programs than for JSP pages.

The basic point is that the CLASSPATH is only valid within the runtime context for which it is set. Running the command "echo $CLASSPATH" only serves to tell you what the CLASSPATH is within the context from which you run the command.


2. Setting the CLASSPATH variable in the context of Concurrent Manager.

There are many places a CLASSPATH can be set. For Concurrent Programs, the important thing is that the file called adovars.env has the proper JDBC driver included in it's CLASSPATH.

For example: when using jdk1.1.8, this should be jdbc 8.0.6, for jdk1.2.2 or greater, it should be jdbc 8.1.6.2 or greater.

Since the Concurrent Manager uses adovars.env when running concurrent requests, this is the place where the CLASSPATH (and other environment variables) should be set correctly.

In case the CLASSPATH is not set correctly, the concurrent requests will end up with the following error: java.lang.NoClassDefFoundError.

It is crucially important that the entire Concurrent Manager be shutdown and restarted after changes were made to file adovars.env.

3. Verifying the value of CLASSPATH variable for a specific request.

To verify that the CLASSPATH change was successful, please follow the next steps:
1. Start a new concurrent request
2. Note the request id
3. Run the following query using the request id

select variable_name,
value
from fnd_env_context e,
fnd_concurrent_processes p,
fnd_concurrent_requests r
where p.concurrent_process_id = e.concurrent_process_id
and p.concurrent_process_id = r.controlling_manager
and e.variable_name='CLASSPATH'
and r.request_id = &REQUEST_ID

This will return the CLASSPATH being used by the concurrent request.

No comments:

Post a Comment