Uploaded image for project: 'CDI TCK'
  1. CDI TCK
  2. CDITCK-273

CustomBeanImplementationTest does not enable an alternative stereotype in a required archive

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Done
    • 1.1.0.Alpha2
    • 2.0.0.Alpha1
    • None
    • None

    Description

      Suppose we have extension that registers two custom beans (while observing AfterBeanDiscovery event). Custom bean A is alternative. Custom bean B is not alternative and has injection point with type A. This scenario causes deployment error: "WELD-001408 Unsatisfied dependencies...".

      It seems that ProcessBean event is not fired after calling javax.enterprise.inject.spi.AfterBeanDiscovery.addBean(Bean<?>) because org.jboss.weld.manager.BeanManagerImpl.isBeanEnabled(Bean<?>) resolves to false at the given moment.

      Nevertheless it is available for injection in "regular" beans after deployment validation (suppose custom bean B is not included).

      Note that if custom bean A#isAlternative() returns false, test passes.

      See TCK test:
      https://github.com/jboss/cdi-tck/tree/master/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/custom

      Attachments

        Issue Links

          Activity

            People

              tremes1@redhat.com Tomas Remes
              mkouba@redhat.com Martin Kouba
              Archiver:
              rhn-support-abdwived Abhishek Dwivedi (Inactive)

              Dates

                Created:
                Updated:
                Resolved:
                Archived: