Home

 

Preparing an exception

The business logic of the session bean throws an exception when errors occur. Let us create an application exception named ITSOBankException:

Right-click the RAD75EJB project and select New Æ Class.

In the New Java Class dialog, type itso.bank.exception as package, and ITSOBankException as Name. Set the superclass to java.lang.Exception. Click Finish.

Complete the code in the editor:

public class ITSOBankException extends Exception {

private static final long serialVersionUID = 1L;

public ITSOBankException(String message) {

super(message);

}

}

Save and close the class.
ibm.com/redbooks