Skip Headers
Oracle® Enterprise Data Quality for Product Data Java API Interface Guide
Release 11g R1 (

Part Number E29133-03
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Feedback page
Contact Us

Go to previous page
Go to next page
PDF · Mobi · ePub

5 Error Handling

This chapter describes the various error handling techniques.

Client-Side Exceptions

Client-side exceptions are caught via the standard java Exception catching mechanism. These faults are typically Connection exceptions, such as request/response timeouts or failure to connect to the server.

Client-Side Log Messages

The client side messages are output using standard output.

The client side messages can be output using a logging package called log4j. The API library uses Java reflection to determine if log4j is available. If it is already in your client application, log4j is used to output messages.

For more information about log4j, see the Apache log4j Web site:

Log4j to Standard Output

By default, client-side error messages will go to standard output.

These same log messages are sent to a log-file if log4j is used in your client application.

If you want to add log4j for use in your client application, then the logger needs to be initialized. Otherwise, you will get the following error message in the standard output window or log file if there is a client-side problem.

log4j:WARN No appenders could be found for logger (oracle.pdq.api1.api.client.ClientBase).
log4j:WARN Please initialize the log4j system properly.

Add the following line of code to initialize the client-side logger, enabling logging output to standard output.

import org.apache.log4j.BasicConfigurator;
. . .
// Initialize Log4J to get client-side logging to standard output

The output in this log is usually a connection re-try attempt or some other client-side processing. Instead of the warning messages, you will now see the following types of messages:

- Attempt 2 to connect to http://lrivas-xp-a31:2229/datalens/Workflow
- Attempt 3 to connect to http://lrivas-xp-a31:2229/datalens/Workflow
- Attempt 4 to connect to http://lrivas-xp-a31:2229/datalens/Workflow

Log4J to a File

If log4j is being use in the client application, then the following will apply.

The client-side logging messages can be sent to a file as well. The following example is a very simple logging configuration that will log all the messages to a log file in the /tmp directory.

import org.apache.log4j.*;
. . .
// Initialize Log4J to get client-side logging to the /tmp directory
Logger logger = 
SimpleLayout layout = new SimpleLayout();
FileAppender appender = null;
try {
    appender = new FileAppender(layout,"/tmp/SCS_Log.txt",false);
} catch(Exception e) {}
logger.setLevel((Level) Level.WARN);


The level for messages can be changed from WARN to DEBUG to get additional information if needed.

Server-Side Faults

There are also server-side exceptions that are propagated back to the client via the SOAP interface.

Here is how those exceptions are caught:

try {
m_client.getResultData (...
        } catch (Fault f) {
        } catch (Exception e) {
            System.out.println("Error in Test: " + e.getMessage());

Server-Side Exceptions

The Fault Exception object will provide a listing of error codes of the problem and status of your request to the Oracle DataLens Server.

Use the macros in the oracle.pdq.api1.api.iface.ErrorIf class to check for specific errors.

For example:

try {
resultData = wfgRtApi.getResultData(m_jobID, waitForResults);
    } catch (Fault f) {
        if (f.getErrorCode() == ErrorIF.ERROR_NOT_COMPLETED) ...

Server-Side Log Messages

Go to the Oracle DataLens Server Administration Web Pages and examine the log file from the home page. This will have a listing of any errors that were encountered in the server-side processing of your request.

Debugging Client Requests and Responses

The Oracle DataLens Server API communicates with the Oracle DataLens Servers by sending HTTP SOAP requests to the server and receiving HTTP SOAP responses back from the server. The content of these XML messages can be sent to standard output for debugging by the application programmer. This is useful if you want to verify that the data being send and received by the application program is exactly what is being communicated to the server.

You can enable this communication by logging into your Oracle DataLens Server Administration Web Pages and then clicking Operations. Select Trace Process Maps as in the following:

Surrounding text describes dsatrace.png.

For more information, see Oracle Enterprise Data Quality for Product Data Oracle DataLens Server Administration Guide.