Handling exceptions

Server Access for J2EE provides the following features for handling exceptions:

Logging and tracing

Server Access for J2EE implements necessary error and tracing interfaces.

In a managed environment

In a managed environment, the application server handles all messages that the WebSphere Access Resource Adapter generates in its own server-specific manner. Usually, you can configure this structure through a console or a deployment descriptor.

Note:
This section summarizes logging and tracing at a high level. For more detailed information, refer to the documentation for your application server.

Debugging a resource adapter is largely dependent on the application server in which the resource adapter is deployed. An Access Resource Adapter handles logging and tracing as follows:

In a non-managed environment

In a non-managed environment, the client application that calls the WebSphere Access Resource Adapter must handle all error logging and tracing.

Exceptions

Server Access for J2EE provides support for exception handling. An application component checks for exceptions that the InterChange Server connection generates through the CCI classes shown in Table 18.

Table 18. CCI classes for exception handling

CCI class Description
ResourceException Thrown by a WebSphere Access Resource Adapter to indicate an exception has occurred in any of the following cases:
  • The processing of data
  • The connection or interaction with InterChange Server.
ResourceWarning Server Access for J2EE does not support this class.

Important:
The J2EE Connector Architecture specification 1.0. provides warnings for the resource adapter to log noncritical errors as it interacts with the EIS. However, Server Access for J2EE does not support warnings. Only the default behavior of the Interaction.getWarnings() method is implemented; that is, this method returns null.

Table 19 shows the types of exceptions that an Access Resource Adapter throws.

Table 19. Types of ResourceException Exceptions

Kind of Exception Description Handled By
Application exception
An exception that occurs while the collaboration executes or ICS is accessed Application component
System exception
An exception not meant to be surfaced to the application component Application system

The exceptions in Table 19 are derived from ResourceException, which extends Exception. A ResourceException provides the following information:

Nearly all CCI methods throw a ResourceException if an error occurs. The application component should catch the ResourceException and take appropriate recovery action. Only methods in the CwInteractionSpec interface do not throw a ResourceException. Instead, the set methods in this interface throw the PropertyVetoException exception.

Copyright IBM Corp. 1997, 2004