On Oct 20, 2008, at 6:18 AM, Luis Fernando Planella Gonzalez wrote:

I've raised a JIRA issue
https://issues.apache.org/jira/browse/OPENEJB-926 because unchecked
application exceptions are being wrapped in an EJB exception, as if were
not an application exception, but the specification says it should be
treated the same way as checked exceptions.

I'm notifying this in the list in order to notify more people, because
nowadays, more and more people are relying on unchecked exceptions (also projects like hibernate 3 or spring), and my project is just stuck with
workarounds until the fix.

Hi Luis,

Secion 14.2.1 clarifies that there are bean provider requirements for application exceptions that are also unchecked exceptions:

    An application exception that is an unchecked exception is
    defined as an application exception by annotating it with the
    ApplicationException metadata annotation, or denoting it in
    the deployment descriptor with the application-exception
    element.

The history here is that in EJB 2.1 and before all unchecked exceptions were considered non-application exceptions (system exceptions). The ability for an unchecked exception to be treated as an application wasn't added until EJB 3.0. You must explicitly say you want this functionality via @ApplicationException or <application- exception> for the given unchecked exception type.

-David

Reply via email to