To be 100% clear, I still prefer 1.(a) as I believe that was the original intention of the spec writers.

I apologize for confusing the issue, I was just trying to explain that in the scenario described, assuming the bean in the ejb-jar was an ejb, OWB actually did follow the described behavior.


Joe Bergmark

From: Mark Struberg <>
To: Pete Muir <>,
Cc: "" <>
Date: 11/27/2012 08:23 AM
Subject: Re: [cdi-dev] [Vote] @ApplicationScoped and visibility
Sent by:

Oki, yea I did read over the EJB part in Joes mail initially.

To sum this up:

EJB does change the TCCL

CDI does NOT change the TCCL.

Sorry that I got confused with EJB popping up unexpectedly. This vote is about CDI and not EJB, so if Joe meant EJBs, then his sentence is correct, but we actually still miss his vote for CDI... Maybe he still prefers 1.(a) but I'd be happy if we can remove the ambiguity by Joe speaking up again.


----- Original Message -----
> From: Pete Muir <>
> To: Mark Struberg <>
> Cc:;
> Sent: Tuesday, November 27, 2012 12:55 PM
> Subject: Re: [cdi-dev] [Vote] @ApplicationScoped and visibility
> Agreed. However, this actually followed on from Joe's comment (which you
> said he was wrong about) "When the EJB is executing, the thread context
> classloader would be that of the ejb module so the correct bean would be
> injected for that module." - which is certainly true in JBoss AS, as Stuart
> said, and I assume as Joe said it, it's true in Websphere too.
> On 26 Nov 2012, at 22:36, Mark Struberg wrote:
>>  perfectly fine for EJBs. But we are talking about CDI and not about EJB!
>>  I've seen no single CDI container doing this so far.
>>  ------------------------------
>>  Stuart Douglas schrieb am Mo., 26. Nov 2012 14:11 PST:
>>>  In AS7 we set the TCCL on each EJB invocation. There is no explicit
> requirement to do this is in the EJB spec as far as I can see, however I
> can't really imagine an implementation not doing this, as you could
> potentially end up with a TCCL that cannot see the EJB class.
>>>  Stuart
>>>  Pete Muir wrote:
>>>>  On 26 Nov 2012, at 19:41, Mark Struberg wrote:
>>>>>  I believe the OWB actually follows 1a
>>>>>  as the question is currently written.  When the EJB is
> executing,
>>>>>  the thread context classloader would be that of the ejb module
> so the correct
>>>>>  bean would be injected for that module.
>>>>  Nope, OWB follows 1b and is thus perfectly in sync with all the
> other EE containers I tested (feel free to grab my app and test yourself!). CDI
> != EJB. There is (currently) no magical TCCL change involved in any CDI call
> chain. Not in OWB and also not in Weld so far afaik.
>>>>  Right. Weld never sets the TCCL. But other things such as EJB might
> to in JBoss AS. Stuart, can you comment?
>>>>  _______________________________________________
>>>>  cdi-dev mailing list
>>  .

cdi-dev mailing list