glassfish
  1. glassfish
  2. GLASSFISH-16115

WELD A Class in a Normal (proxiable) scope that extends a class with final methods is NOT caught at deployment time

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 4.0
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      Ubuntu Linux 10.04 x86, Sun JVM 1.6.0_24-b07

      Description

      Using javax.enterprise.inject.Instance, my application is able to inject objects at runtime. The qualifier annotations are defined properly (runtime retention, method/field/parameter/type targets, @Qualifier), with a single member string (value). The string value is binding (i.e. no @NonBinding annotation)

      The annotated, @Dependent class is also properly annotated.

      In Glassfish 3.0.1, this injection model works perfectly.

      In Glassfish 3.1, CDI (WELD) raises an exception that it can't satisfy the dependency.

      Clearly, all jars/WARs have "beans.xml" in the right place (else it wouldn't work with 3.0.1).

      All other (static) injection appears to be working normally.

        Activity

        Hide
        jwells added a comment -

        Weld has fixed this bug, and the test that catches this bug has been re-enabled with change 61362

        Show
        jwells added a comment - Weld has fixed this bug, and the test that catches this bug has been re-enabled with change 61362
        Show
        jjsnyder83 added a comment - https://issues.jboss.org/browse/WELD-1388
        Hide
        jwells added a comment -

        I have submitted a test case under appserver/tests/cdi/negative/normalScopeWithFinal. The test is currently disabled (as the JAR erroneously is deployed). We should keep this bug open until the test case succeeds.

        Show
        jwells added a comment - I have submitted a test case under appserver/tests/cdi/negative/normalScopeWithFinal. The test is currently disabled (as the JAR erroneously is deployed). We should keep this bug open until the test case succeeds.
        Hide
        jjsnyder83 added a comment -

        I have forward the information to JBoss.

        Show
        jjsnyder83 added a comment - I have forward the information to JBoss.
        Hide
        jwells added a comment -

        Section 5.4.1 of the CDI specification (1.0) states that a bean in a Normal scope must not have final methods, and that such an injection point should be handled as a deployment error. Here is the exact wording:

        If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the
        container automatically detects the problem and treats it as a deployment problem.

        If I have a class B that extends a class A, where B is in a Normal scope (@ApplicationScoped) and A has a final method the error is NOT caught (still, with the latest Weld) and is later manifested in a NullPointerException when Weld tries to proxy the class. If I add a final method to B the error IS caught at deployment time and made into a deployment failure.

        This looks to me like an error in Weld, for which I can provide a simple test case.

        Show
        jwells added a comment - Section 5.4.1 of the CDI specification (1.0) states that a bean in a Normal scope must not have final methods, and that such an injection point should be handled as a deployment error. Here is the exact wording: If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem. If I have a class B that extends a class A, where B is in a Normal scope (@ApplicationScoped) and A has a final method the error is NOT caught (still, with the latest Weld) and is later manifested in a NullPointerException when Weld tries to proxy the class. If I add a final method to B the error IS caught at deployment time and made into a deployment failure. This looks to me like an error in Weld, for which I can provide a simple test case.

          People

          • Assignee:
            jwells
            Reporter:
            drivera
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: