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

Bean in different wars should be allowed to have the same EL name

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Normally two beans with the same @Named would be treated as an error. If they are in sperate war's this should be allowed.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            pmuir Pete Muir added a comment -

            I think this is better expressed as two beans with the same @Named name should be disallowed if the modularity system in use means they can see each other. Not in terms of wars.

            Show
            pmuir Pete Muir added a comment - I think this is better expressed as two beans with the same @Named name should be disallowed if the modularity system in use means they can see each other. Not in terms of wars.
            Hide
            thargor Simon Walter added a comment -

            Is there a chance this problem will be fixed in the foreseeable future?

            Show
            thargor Simon Walter added a comment - Is there a chance this problem will be fixed in the foreseeable future?
            Hide
            struberg Mark Struberg added a comment -

            Let's start at the beginning:

            a.) where is this defined in the CDI spec? Imo there is no such a wording!

            b.) the only restriction is that getBeans by name must resolve to one unique Bean otherwise an AmbiguousResolutionException gets thrown. (section 11.3.7)

            But according to the EE spec, WebAppA must not see Classes (and thus Beans) from WebAppB. I expect you are using an EE server with a flat out isolation, or Weld simply ignores the isolation. But that's not a problem in the spec itself imo.

            Pete, do you agree?

            Show
            struberg Mark Struberg added a comment - Let's start at the beginning: a.) where is this defined in the CDI spec? Imo there is no such a wording! b.) the only restriction is that getBeans by name must resolve to one unique Bean otherwise an AmbiguousResolutionException gets thrown. (section 11.3.7) But according to the EE spec, WebAppA must not see Classes (and thus Beans) from WebAppB. I expect you are using an EE server with a flat out isolation, or Weld simply ignores the isolation. But that's not a problem in the spec itself imo. Pete, do you agree?
            Hide
            thargor Simon Walter added a comment -

            I'm not Pete but I agree.

            We are using Jboss 7.1.0CR1.

            If this is a bug in Jboss WAR-Isolation can this Bug be moved to the appropriate project or should we open a new one?

            Show
            thargor Simon Walter added a comment - I'm not Pete but I agree. We are using Jboss 7.1.0CR1. If this is a bug in Jboss WAR-Isolation can this Bug be moved to the appropriate project or should we open a new one?
            Hide
            pmuir Pete Muir added a comment -

            No, this is discussed, and IIRC, TCK'd.

            "All unresolvable ambiguous EL names are detected by the container when the application is initialized."

            from 5.3.1

            So all ambiguities are "fail-fast", not runtime fail as Mark describes.

            However yes, I'm not 100% sure why War isolation is not good enough here.

            Jozef, could you test in Weld quickly?

            Show
            pmuir Pete Muir added a comment - No, this is discussed, and IIRC, TCK'd. "All unresolvable ambiguous EL names are detected by the container when the application is initialized." from 5.3.1 So all ambiguities are "fail-fast", not runtime fail as Mark describes. However yes, I'm not 100% sure why War isolation is not good enough here. Jozef, could you test in Weld quickly?
            Hide
            pmuir Pete Muir added a comment -

            And bizarrely, the spec already says what I said in my comment (available for injection).

            Simon, in terms of when, we will definitely sort this out one way or another for CDI 1.1 (if it's just a bug in Weld / AS7, asap, otherwise for CDI 1.1 at the end of 2012).

            Show
            pmuir Pete Muir added a comment - And bizarrely, the spec already says what I said in my comment (available for injection). Simon, in terms of when, we will definitely sort this out one way or another for CDI 1.1 (if it's just a bug in Weld / AS7, asap, otherwise for CDI 1.1 at the end of 2012).
            Hide
            jharting Jozef Hartinger added a comment -

            "An ambiguous EL name exists in an EL expression when an EL name resolves to multiple beans."

            My interpretation is that the spec already allows same bean names as far as the beans do not see each other.

            Thus, this is only a bug in Weld/AS7 integration (WELD-1065).

            Show
            jharting Jozef Hartinger added a comment - "An ambiguous EL name exists in an EL expression when an EL name resolves to multiple beans." My interpretation is that the spec already allows same bean names as far as the beans do not see each other. Thus, this is only a bug in Weld/AS7 integration ( WELD-1065 ).
            Hide
            pmuir Pete Muir added a comment -

            Was a bug in weld

            Show
            pmuir Pete Muir added a comment - Was a bug in weld

              People

              • Assignee:
                jharting Jozef Hartinger
                Reporter:
                swd847 Stuart Douglas
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development