[seam-dev] Overriding annotated types and the SPI

Stuart Douglas stuart at baileyroberts.com.au
Mon Nov 23 02:37:22 EST 2009

I am trying to register an additional bean. It works perfectly when the class is not in a bean deployment archive, however if QualifiedBean2 is in a bean deployment archive then it stops working. The bean itself does not have any annotations.


From: Gavin King [gavin.king at gmail.com]
Sent: Monday, 23 November 2009 6:29 PM
To: Stuart Douglas
Cc: seam-dev at lists.jboss.org
Subject: Re: [seam-dev] Overriding annotated types and the SPI

Are you trying to:

(a) *override* the bean that the container creates, or
(b) are you trying to register additional beans?

If (a), you would need to call veto() on the AnnotatedType created by
the container.

On Mon, Nov 23, 2009 at 1:19 AM, Stuart Douglas
<stuart at baileyroberts.com.au> wrote:
> I have been working on my XML configuration extension and have been making good progress, however I have run into some behavior that I cannot explain.
> At the moment in my XML file I can do this:
>    <test:OtherQualifier>
>        <Qualifier/>
>    </test:OtherQualifier>
> <test:QualifiedBean2>
>        <test:OtherQualifier value1="BB" value2="2"/>
>    </test:QualifiedBean2>
> <test:QualifierTestBean>
>     <test:bean2>
>            <test:OtherQualifier value1="BB" value2="2"/>
>            <Inject/>
>     </test:bean2>
> </test:QualifierTestBean>
> When my extension sees this it creates two AnnotatedTypes and a Qualifier and registers them in the BeforeBeanDiscovery event. This all works fine, QualifiedBean2 gets injected into QualifierTestBean and life is good.
> However if QualifiedBean2 is deployed inside a Bean archive things suddenly go pear shaped, all of a sudden the container seems to forget about the qualifier on QualifiedBean2 and it stops working. Does anyone have any idea what could be causing this? It looks like the bean deployment process is overriding my user supplied type level metadata.
> Thanks,
> Stuart
> _______________________________________________
> seam-dev mailing list
> seam-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/seam-dev

Gavin King
gavin.king at gmail.com

More information about the seam-dev mailing list