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!

Comments:

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
...the last 150 posts
...the last 10 comments
License