Weld
  1. Weld
  2. WELD-846

Incorrect handling of cyclic dependencies between BeanDeploymentArchives

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 1.1.0.Final
    • Fix Version/s: 1.1.1.Final
    • Component/s: Resolution
    • Labels:
      None
    • Environment:
      GlassFish 3.1
    • Steps to Reproduce:
      Hide
      • Install latest GlassFish 3.1 nightly http://dlc.sun.com.edgesuite.net/glassfish/3.1/nightly/latest-glassfish.zip to $INSTALL_ROOT
      • To see Weld-integration related debug information add the following line to $INSTALL_ROOT/glassfish3/glassfish/domains/domain1/config/logging.properties:
        org.glassfish.weld.level=FINE
        The server logs would be available at $INSTALL_ROOT/glassfish3/glassfish/domains/domain1/logs/server.log
      • start domain and database:
        $INSTALL_ROOT/glassfish3/glassfish/bin/asadmin start-domain domain1
        $INSTALL_ROOT/glassfish3/glassfish/bin/asadmin start-database
      • and execute the following Arquillian tests in Seam Solder
        mvn clean test -Dincontainer-glassfish-rest -Dtest=TypeVisibilityWithinBeanArchiveTest
        mvn clean test -Dincontainer-glassfish-rest -Dtest=TypeVisibilityForExtensionInNonBeanArchiveTest
      Show
      Install latest GlassFish 3.1 nightly http://dlc.sun.com.edgesuite.net/glassfish/3.1/nightly/latest-glassfish.zip to $INSTALL_ROOT To see Weld-integration related debug information add the following line to $INSTALL_ROOT/glassfish3/glassfish/domains/domain1/config/logging.properties: org.glassfish.weld.level=FINE The server logs would be available at $INSTALL_ROOT/glassfish3/glassfish/domains/domain1/logs/server.log start domain and database: $INSTALL_ROOT/glassfish3/glassfish/bin/asadmin start-domain domain1 $INSTALL_ROOT/glassfish3/glassfish/bin/asadmin start-database and execute the following Arquillian tests in Seam Solder mvn clean test -Dincontainer-glassfish-rest -Dtest=TypeVisibilityWithinBeanArchiveTest mvn clean test -Dincontainer-glassfish-rest -Dtest=TypeVisibilityForExtensionInNonBeanArchiveTest
    • Similar Issues:
      Show 10 results 

      Description

      This issue occurs in GlassFish with the scenarios discussed in http://java.net/jira/browse/GLASSFISH-15735 and http://java.net/jira/browse/GLASSFISH-15721 when GlassFish provides BDA hierarchies where there are cyclic dependencies between constituent BDAs.

      While constructing BeanDeployments for the deployed BDA in in WeldBootstrap.DeploymentVisitor, and visiting the tree of BDAs, the code appears to incorrectly check for seenBeanDeploymentArchives for adding accessibleBeanManagers for a child BDA.

      GlassFish uses the following BDA hierarchy for a WAR with a bundled library (WEB-INF/lib/*.jar):
      WAR-BDA (accessible-BDAs=WEB-INF/lib/A)

      • WEB-INF/lib/A's BDA (accessible-BDAs=WAR-BDA)

      In WeldBootstrap.DeploymentVisitor.visit(...)
      -. initial invocation:
      managerAwareBeanDeploymentArchives and seenBeanDeploymentArchives are populated with WAR-BDA

      • - then as part of the WAR-BDA's getBeanDeploymentArchives loop:
      • - - visiting WEB-INF/lib/A's BDA
        managerAwareBeanDeploymentArchives and seenBeanDeploymentArchives are now populated with WAR-BDA and WEB-INF/lib/A's BDA
      • - - - then as part of the WEB-INF/lib/A's getBeanDeploymentArchives loop:
      • - - - - WAR BDA is an accessible BDA of WEB-INF/lib/A BDA. However since WAR BDA is in seenBeanDeploymentArchives, WAR-BDA is never added as an accessible BeanManager of WEB-INF/lib/A's BDA

      This prevents Beans from WAR BDA being available in the WEB-INF/lib BDA though it is included as an accessible BDA.

        Activity

        Show
        Stuart Douglas
        added a comment - https://github.com/stuartwdouglas/core/tree/WELD-846
        Show
        Ales Justin
        added a comment - https://github.com/weld/core/compare/800ffe8...0ce11af
        Hide
        Dominik Sadowski
        added a comment -

        Is that bug really fixed?
        I used weld-core build from https://issues.jboss.org/browse/WELD-859 on GF3_b43(web), and second test 'TypeVisibilityForExtensionInNonBeanArchiveTest' gives error for me:
        org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [BeanClassToRegister] with qualifiers [@Default] at injection point [[field] @Inject private org.jboss.seam.solder.test.compat.AnotherBeanClassToRegister.collaborator]. Possible dependencies [[Managed Bean [class org.jboss.seam.solder.test.compat.BeanClassToRegister] with qualifiers [@Any @Default], Managed Bean [class org.jboss.seam.solder.test.compat.BeanClassToRegister] with qualifiers [@Any @Default]]]

        first test passes OK

        please confirm that (eventually reopen)

        Show
        Dominik Sadowski
        added a comment - Is that bug really fixed? I used weld-core build from https://issues.jboss.org/browse/WELD-859 on GF3_b43(web), and second test 'TypeVisibilityForExtensionInNonBeanArchiveTest' gives error for me: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [BeanClassToRegister] with qualifiers [@Default] at injection point [ [field] @Inject private org.jboss.seam.solder.test.compat.AnotherBeanClassToRegister.collaborator]. Possible dependencies [[Managed Bean [class org.jboss.seam.solder.test.compat.BeanClassToRegister] with qualifiers [@Any @Default] , Managed Bean [class org.jboss.seam.solder.test.compat.BeanClassToRegister] with qualifiers [@Any @Default] ]] first test passes OK please confirm that (eventually reopen)
        Hide
        Dominik Sadowski
        added a comment -

        update: what is not clear to me is surefire-report I got when running 'TypeVisibilityForExtensionInNonBeanArchiveTest', u can see it here:

        http://pastebin.com/6BZuavq2

        it contains exceptions originated from jersey client which is used by
        org.jboss.arquillian.container:arquillian-glassfish-remote-3.1:1.0.0-SNAPSHOT

        are these normal? (ie. implication of previous weld exception - I got on gf console/server.log)

        Show
        Dominik Sadowski
        added a comment - update: what is not clear to me is surefire-report I got when running 'TypeVisibilityForExtensionInNonBeanArchiveTest', u can see it here: http://pastebin.com/6BZuavq2 it contains exceptions originated from jersey client which is used by org.jboss.arquillian.container:arquillian-glassfish-remote-3.1:1.0.0-SNAPSHOT are these normal? (ie. implication of previous weld exception - I got on gf console/server.log)
        Hide
        Stuart Douglas
        added a comment -

        TypeVisibilityForExtensionInNonBeanArchiveTest is a test for a different issue, how the container treats extensions that are not deployed as part of a bean archive.

        Show
        Stuart Douglas
        added a comment - TypeVisibilityForExtensionInNonBeanArchiveTest is a test for a different issue, how the container treats extensions that are not deployed as part of a bean archive.

          People

          • Assignee:
            Stuart Douglas
            Reporter:
            Sivakumar Thyagarajan
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: