Undeclared @ApplicationException annotated RuntimeExceptions are always wrapped 
in EJBExceptions
------------------------------------------------------------------------------------------------

                 Key: OPENEJB-1052
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1052
             Project: OpenEJB
          Issue Type: Bug
    Affects Versions: 3.1.1
         Environment: Windows XP, Java 1.6, Maven 2.0.9
            Reporter: Falko Modler


RuntimeExceptions that are annotated with @javax.ejb.ApplicationException are 
only handled as application exceptions when they are declared by the EJB method 
(or by an Interceptor AroundInvoke method).

When such an annotated exception is NOT declared by the "throwing method", it 
get's wrapped into an EJBException - with all the consequences (EJB will be 
discarded, transaction will be rolled back)!

Example:

@javax.ejb.ApplicationException(rollback=false)
public class SomeApplicationException extends RuntimeException { ...

Given an EJB method someEJBMethod that throws SomeApplicationException; this 
will prevent SomeApplicationException to be wrapped in an EJBException:

public void someEJBMethod(...) throws SomeApplicationException { ...

But this will not work (SomeApplicationException will be wrapped):

public void someEJBMethod(...) { ...


In contrast: JBOSS 4.2.3 always evaluates @javax.ejb.ApplicationException, not 
just for declared exceptions! This is what I expect openejb to do as well...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to