[weld-issues] [JBoss JIRA] (WELD-998) Alternative custom bean not available for injection in other custom bean

Jozef Hartinger (JIRA) jira-events at lists.jboss.org
Thu May 17 10:04:18 EDT 2012


     [ https://issues.jboss.org/browse/WELD-998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jozef Hartinger updated WELD-998:
---------------------------------

    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

  was:
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/jsr299/tck/tests/definition/bean/custom


    
> Alternative custom bean not available for injection in other custom bean
> ------------------------------------------------------------------------
>
>                 Key: WELD-998
>                 URL: https://issues.jboss.org/browse/WELD-998
>             Project: Weld
>          Issue Type: Bug
>    Affects Versions: 1.1.2.Final
>            Reporter: Martin Kouba
>             Fix For: 2.0.0.Alpha3
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list