4 Replies Latest reply on Mar 26, 2013 11:33 AM by Ievgen Shulga

    CDI alternative stereotype don't work properly with JBoss 7.1.1.

    Ievgen Shulga Newbie

      Hi everyone,


      I want to apply alternative stereotype, but cant make it work. I have 2 implementation of interface:




      public class ItemExtensionServiceBean implements ItemService {





      public class ItemServiceBean implements ItemService {


      alternative stereotype annotation:





      @Target({ TYPE, METHOD, FIELD })

      public @interface AlternativeStereotype {








      and JSF bean where I inject ItemService interface.




      public class ItemBean {


          private ItemService itemService;


      But after deploy aletrnative implementation ItemExtensionServiceBean is not used.

      Tutorial http://docs.jboss.org/weld/reference/1.1.0.Final/en-US/html/stereotypes.html says it supposed to work.


      1. Is it supopsed to work?

      2. How can I make it work?

      I have a simple reproducer on github: https://github.com/ishulga/cdi