[cdi-dev] [JBoss JIRA] (CDI-459) Clarify whether CDI should validate beans that are not enabled

Jozef Hartinger (JIRA) issues at jboss.org
Mon Sep 8 08:05:00 EDT 2014

Jozef Hartinger created CDI-459:

             Summary: Clarify whether CDI should validate beans that are not enabled
                 Key: CDI-459
                 URL: https://issues.jboss.org/browse/CDI-459
             Project: CDI Specification Issues
          Issue Type: Clarification
          Components: Beans
    Affects Versions: 1.2.Final
            Reporter: Jozef Hartinger

CDITCK-438 opens up an interesting question. Should CDI validate beans that are not enabled?

First, we need to make a distinction between a *definition error* (e.g. a field that is annotated with both {{@Inject}} and {{@Producer}} ) and a *deployment problem* (e.g. an unsatisfied dependency).

The spec currently explicitly requires deployment problems to be detected on enabled beans only:
{quote}The container must validate all injection points of all *enabled beans*, all observer methods, all disposer methods and all other Java EE component classes supporting injection when the application is initialized to ensure that there are no unsatisfied or unresolvable ambiguous dependencies. {quote}

However, It is not explicitly defined for definition errors, e.g:
If a Bean instance with qualifier @Intercepted is injected into a bean instance other than an interceptor instance, the container automatically detects the problem and treats it as a definition error.
does not say anything about enablement of the bean.

This message was sent by Atlassian JIRA

More information about the cdi-dev mailing list