Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-459

Clarify whether CDI should validate beans that are not enabled

XMLWordPrintable

    • Icon: Clarification Clarification
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 1.2.Final
    • Beans
    • None

      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:

      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.

      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.

            Unassigned Unassigned
            rhn-engineering-jharting Jozef Hartinger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: