Exception handling is essential to any robust application. Understanding what constitutes a good exception handling technique is important in creating robust applications. In this recipe, we will examine several of these techniques, and see how we can apply them to Java EE applications.
Knowing where to handle exceptions is the key to the proper use of exception handling. The organization of the exception handling code is dependent upon the structure of the application. Exception handling can be viewed from a development and a production standpoint, both of which are important.
When an exception occurs in an EJB that it cannot recover from, it is typically wrapped in an EJBException and then thrown to the caller.