There are two types of exceptions in EJB: application exception and system exception. This guide will show how to identify and implement both of them.
Why two types of exceptions in EJB?
In EJB, it’s important to know whether an exception has occurred because of a business problem or a system error. That way, EJB exceptions are split in two to represent a maybe recoverable business problem (like an ordinary checked exception in Java) or a unexpected and unrecoverable issue caused by a system error or bad coding (like common runtime exceptions).
After all the concepts involved, they are just ordinary exceptions with meaningful metadata defined by annotations or XML configuration in the deployment descriptor to tell the EJB container how to deal with them.
Read More »EJB: Application Exception vs System Exception