dev@jsr311.java.net

Re: JSR311: default EJBExceptionMapper in spec...

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 24 Aug 2009 15:13:24 +0200

On Aug 21, 2009, at 4:10 PM, Marc Hadley wrote:

> On Aug 20, 2009, at 5:40 AM, Paul Sandoz wrote:
>>
>> I too have encountered the same issue. Marc and I were discussing
>> it, and we concluded that WebAppliationException should be allowed
>> to pass through, but i guess why not any RuntimeException?
>>
>> I was scratching my head trying to work out a solution dependent on
>> EJB APIs but it is not possible and the spec states that only
>> Runtime exceptions in the war/ear annotated with
>> ApplicationException will be recognized. Thus it will not be
>> portable for a JAX-RS implementation distributed as part of an app
>> server.
>>
>> Thus i think what you propose is a good one. Now i can fix a bug :-)
>>
> The current changelog has the following:
>
> - In a product that also supports EJB, an implementation MUST
> support use of stateless and singleton session beans as root
> resource classes and providers in a Web application. JAX-RS
> annotations MAY be applied to a beanís local interface or directly
> to a no-interface bean. A WebApplicationException thrown by an EJB
> resource class or provider method MUST be treated as an EJB
> application exception.
>
> If we change that to:
>
> - In a product that also supports EJB, an implementation MUST
> support use of stateless and singleton session beans as root
> resource classes and providers in a Web application. JAX-RS
> annotations MAY be applied to a beanís local interface or directly
> to a no-interface bean. If an ExceptionMapper for a EJBException or
> subclass is not included with an application then Exceptions thrown
> by an EJB resource class or provider method MUST be treated as EJB
> application exceptions: the embedded cause MUST be unwrapped and
> processed as described in section 3.3.4.
>
> Does that cover it ?
>

I think so.

Paul.