This discussion is archived
0 Replies Latest reply: May 3, 2012 4:08 AM by 934779 RSS

@Qualifier with array member

934779 Newbie
Currently Being Moderated

I want to develop a CDI Qualifier to differentiate between bean implementations at injection points. As long as i use a single enum as member, everythings works fine. But if i change from enum to array of enum, i got an exception on deployment. Can someone explain this to me?

The qualifier:
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.TYPE })
public @interface MultiTenancy {
    Tenant[] value() default { Tenant.COMPANY1 };
Anotation in use:
@MultiTenancy({ Tenant.COMPANY2 })
public class InvoiceServiceBean implements InvoiceService {
The Exception:
org.jboss.weld.exceptions.IllegalArgumentException: WELD-001301 Annotation @MultiTenancy(value=[COMPANY2]) is not a qualifier
    at org.jboss.weld.resolution.ResolvableBuilder.checkQualifier(
    at org.jboss.weld.resolution.ResolvableBuilder.addQualifier(
    at org.jboss.weld.resolution.ResolvableBuilder.addQualifiers(
    at org.jboss.weld.manager.BeanManagerImpl.resolveDecorators(
    at org.jboss.weld.bean.AbstractClassBean.initDecorators(
    at org.jboss.weld.bean.AbstractClassBean.initializeAfterBeanDiscovery(
    at org.jboss.weld.bean.SessionBean.initializeAfterBeanDiscovery(
    at org.jboss.weld.bootstrap.BeanDeployment.doAfterBeanDiscovery(
    at org.jboss.weld.bootstrap.BeanDeployment.afterBeanDiscovery(
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(
I am using JBoss 7.1.1 and Java JDK1.6.0_32

Thanks in advance


  • Correct Answers - 10 points
  • Helpful Answers - 5 points