Unwrapping Exceptions With ApplicationException

ApplicationException annotation is often used at project-specific checked exception to force the application server to rollback the transaction:

public class MyException extends Exception{}

However, the main feature is already well described in the JavaDoc:

"Applied to an exception to denote that it is an application exception and should be reported to the client directly (i.e., unwrapped)."[javadoc]

Omitting the wrapping is particularly useful in microservice architectures implemented with JAX-RS (screencast).

See you at Java EE Workshops at Munich Airport, Terminal 2, particularly at: Effective Java EE 7 and / or Java EE 7 Microservices!

NEW: Online Workhop Effective WebApps without Frameworks is also coming to: MUC Airport.

Airport MUC workshops: Web (SPA, PWAs, Offline, Desktop, Mobile) Applications Essentials and Effective Web Applications. No migrations. #usetheplatform

Podcast: airhacks.fm and newsletter: airhacks.news

A book about rethinking Java EE Patterns


So this will not be wrapped into EJBException?

Posted by elo on November 17, 2016 at 08:59 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments