Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-304

test applications failed to deploy due to "unresolvable ambiguous EL name exists"

    XMLWordPrintable

Details

    Description

      I am investigation the test failures for org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.EnterpriseBeanSpecializationTest class. The deployment failed for the application due to some validation failure in weld RI code.

      From the stack trace, it found two beans with name "farmer":
      Caused by: org.jboss.weld.DeploymentException: An unresolvable ambiguous EL name exists for farmer; found [org.jboss.weld.bean-/home/hzhang/files/sun/glassfishv3/glassfish/domains/domain1/applications/org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.EnterpriseBeanSpecializationTest/org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.EnterpriseBeanSpecializationTest_jar/-SessionBean-LazyFarmer, org.jboss.weld.bean-/home/hzhang/files/sun/glassfishv3/glassfish/domains/domain1/applications/org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.EnterpriseBeanSpecializationTest/org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.EnterpriseBeanSpecializationTest_jar/-SessionBean-Farmer]
      at org.jboss.weld.Validator.validateBeanNames(Validator.java:321)
      at org.jboss.weld.Validator.validateDeployment(Validator.java:273)
      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:389)
      at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:166)

      So I tried to step into weld RI code to see why this happened.

      This is what I found so far:
      1. The Farmer class has a @Named annotation, and AbstractBean.initName() would set its name as the default name (the simple name of the class): "farmer".
      2. The LazyFarmer class extends from Farmer class and does not have a @Named annotation, so AbstractBean.initName() does not assign any name to it. Its name is later assigned in AbstractBean.postSpecialize using its specialized bean's name (this.name = getSpecializedBean().getName()). Its specialized bean is its super class Farmer, and Farmer's name is "farmer". So now LazyFarmer's name is also "farmer".

      Seems from the RI code, it's expected these two beans will have the same name "farmer". So not sure how this test would pass with the current TCK/RI.

      This is also the cause of the deployment failure for org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.EnterpriseBeanSpecializationIntegrationTest

      Attachments

        Activity

          People

            pmuiratbleepbleep Pete Muir (Inactive)
            hzhang_jb Hong Zhang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: