[javaee-spec users] Re: About bean-discovery-mode="annotated" from CDI 1.1

From: Tang Yong <>
Date: Tue, 24 Sep 2013 11:14:51 +0900


> Are you just asking that @Interceptor be considered a bean-defining

Yes, here, I think that bean-discovery-mode="annotated" is incomplete or
  ambiguous for Interceptor, just as you said, since interceptors are
beans, CDI Spec should consider more bean-defining annotations not only

So, according to the following exception and Interceptor's definition,

"WELD-001417 Enabled interceptor class <class>...</class> in
...META-INF/beans.xml_at_7 is neither annotated @Interceptor nor registered
through a portable extension"

[My Proposal]
1. adding @Interceptor as bean-defining annotation
2. scanning principle is as following while bean-discovery-mode="annotated":

1) firstly seeing whether having any <interceptors> defined in beans.xml

2) if having <interceptors> definition, seeing whether the class has
been annotated @Interceptor, if having @Interceptor, the interceptor
will be as bean.

3. adding @InterceptorBinding as bean-defining annotation
if having scanning an interceptor, any class only with
@InterceptorBinding should be as an intecepted bean. About the point,
needing to confirm deeply.


Bill Shannon wrote:
> This is really a CDI question, probably better addressed to the CDI spec lead...
> As I understand it, bean-discovery-mode="annotated" means you only want to
> find bean classes that have been annotated with bean-defining annotations
> (Just scopes, as far as I can tell). Interceptors are beans, so, if you want
> your interceptor to be found in this case, you need to give it a scope, e.g.,
> @Dependent.
> Are you just asking that @Interceptor be considered a bean-defining annotation?
> Tang Yong wrote on 09/22/13 20:20:
>> Hello Bill
>> Recently, [1] and [2] has reported an issue about
>> bean-discovery-mode="annotated". Although there are some workarounds for
>> the issue, I think that in the future, we should support interceptor
>> implict scanning while an user uses bean-discovery-mode="annotated".
>> Apparently, just as bean-discovery-mode="annotated", CDI Spec and
>> Interceptor Spec are disconnected.
>> Wish to listen to your comment.
>> [1]:
>> [2]:
>> Thanks
>> Tang

Tang Yong
Senior Engineer
GlassFish Committer (OSGi & OSGi-JavaEE)
OSGi Alliance Supporter
Nanjing Fujitsu NanDa Software Tec CO.,LTD
Tel: +86-25-86630566-8310
Fax: +86-25-83317685