+

Search Tips   |   Advanced Search

Set the system property to enable remote EJB clients to receive nested or root-cause exceptions

We might want to code the application to perform a given action if a certain kind of exception is the root-cause of a failure and is nested within the exception that you receive. The default behavior in the product might mask a nested or root-cause exception in the application.

The EJB container creates a TransactionRolledbackException exception for a remote client when it can create a RemoteException exception instead. With the RemoteException exception, the container does not lose the ability to have root-cause information nested inside the exception.

We can set the following JVM system property to true through the console for the product: com.ibm.websphere.ejbcontainer.includeRootExceptionOnRollback This change enables the remote client to receive nested exceptions when a rollback occurs.

This property is applicable only for scenarios where the transaction in which the bean method is running was started by the container for this specific method invocation. All of the other scenarios must result in a TransactionRollBackException exception according to the EJB specification.

  1. Open the console.

  2. Select Servers.

  3. Select Servers > Application servers > server_name.

  4. Under Server infrastructure, select Java and Process Management > Process Definition.

  5. Under Additional properties, select Java virtual machine > Custom properties > New.

  6. In the Name entry field, type com.ibm.websphere.ejbcontainer.includeRootExceptionOnRollback.

  7. In the Value entry field, type true.

  8. Select OK.