Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying a stereotype with a qualifier won't work?

Tags:

cdi

jboss-weld

Specifying a stereotype with a qualifier?

I can't understand why it seems illegal to include a qualifier when specifying a stereotype?

Trying to do so resulted in the following error message:

jboss.weld.exceptions.DefinitionException: 
WELD-001103 Cannot declare qualifiers on stereotype interface

If this is by design I am curious to why or am I doing anything wrong? Tried to search this but could not find anything

cheers

like image 491
Karl Kildén Avatar asked Sep 04 '25 02:09

Karl Kildén


1 Answers

From how I understand the specification, the main idea of a qualifier is to qualify a single bean type in case that there are ambiguous dependencies.

In contrast to that, the main idea of a stereotype is to bundle individual combinations of scope / named / interceptor / alternative annotatons to be re-used on multiple beans.

That kind of contradicts each other - so I'm not too surprised that this is forbidden by the container - event though it's only implicitly targeted by the spec (by not naming qualifiers as being allowed for stereotypes).

like image 89
Jan Groth Avatar answered Sep 07 '25 19:09

Jan Groth