adam bien's blog

Unwrapping Exceptions With ApplicationException 📎

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

@ApplicationException(rollback=true)
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!