[jbosstools-issues] [JBoss JIRA] (JBIDE-17812) "No bean is eligible for injection" warning for beans added in AfterBeanDiscovery

Ron Šmeral (JIRA) issues at jboss.org
Mon Jul 7 13:12:24 EDT 2014


Ron Šmeral created JBIDE-17812:
----------------------------------

             Summary: "No bean is eligible for injection" warning for beans added in AfterBeanDiscovery
                 Key: JBIDE-17812
                 URL: https://issues.jboss.org/browse/JBIDE-17812
             Project: Tools (JBoss Tools)
          Issue Type: Bug
          Components: cdi-extensions
            Reporter: Ron Šmeral


JBDS shows _No bean is eligible for injection to the injection point_ warning for injection points where the beans are provided by an extension in the ABD event:

{code:java|title=ByIdExtensionTest.java}
@Inject @ById("rbenevides") 
private Person rafael;
{code}
* shows _No bean is eligible for injection to the injection point \[JSR-299 §5.2.1\]_

{code:java|title=ByIdExtension.java}
public void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager bm) {
    for (final String idValue : ids) {
        BeanBuilder<Person> beanBuilder = new BeanBuilder<Person>(bm)
                .beanClass(Person.class)
                .types(Person.class, Object.
                .qualifiers(new ByIdLiteral(idValue))
                .beanLifecycle(new PersonContextualLifecycle(idValue));
        abd.addBean(beanBuilder.create());
    }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)



More information about the jbosstools-issues mailing list