1 Reply Latest reply on Jan 10, 2012 3:57 AM by jharting

    Alternative through @Stereotype can not be enable

    jsimao71
      I've this stereotype:

      @Stereotype
      @Inherited
      @Alternative
      @Named
      @ApplicationScoped
      @Target({ TYPE })
      @Retention(RUNTIME)
      @Documented
      public @interface Repository {
      }

      And use it in a Dao:
      @Repository
      public class JdbcAccountDao extends JdbcAbstractDao implements AccountDao {
      ...
      }

      but when I try to enable JdbcAccountDao in beans.xml:

      <alternatives>
              <stereotype>ebank.annotation.Repository</stereotype>
              <class>ebank.dao.jdbc.JdbcAccountDao</class>
      </alternatives>

      it does not work...give error:

      org.jboss.weld.exceptions.DeploymentException: WELD-001422 Enabled alternative <class>ebank.dao.jdbc.JdbcAccountDao</class> in file:/home/jsimao/mydocs/courses/jee/workspace/jee-01-cdi-ebank/bin/META-INF/beans.xml@16 is not annotated @Alternative


      Any guess?....
      ...it should work, according to the CDI spec...right?

      Thanks in advance for your help,
      Jorge.