WAS v8.5 > Develop applications > Develop EJB applications > Develop enterprise beansSet the system property to enable remote EJB clients to receive nested or root-cause exceptions
You 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 dmgr 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.
- Open the dmgr console.
- Select Servers.
- Select Servers > Application servers > server_name.
- Under Server infrastructure, select Java and Process Management > Process Definition.
- Under Additional properties, select Java virtual machine > Custom properties > New.
- In the Name entry field, type com.ibm.websphere.ejbcontainer.includeRootExceptionOnRollback.
- In the Value entry field, type true.
- Select OK.