Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-5955

Usage of custom scopes breaks functioning of circular references

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0 M3
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      The following construct brings up a BeanCurrentlyInCreationException.

       
      <bean name="A" class="foo.bar.X" scope="session">
        <property name="refToB" ref="B"/>
      </bean>
      
      <bean name="B" class="foo.bar.Y" scope="session">
        <property name="refToA" ref="a"/>
      </bean>
      

      As the example shows clearly, there are no problematic references via constructor-arg involved and the same construct but with scope="singleton" does actually work. I see no reason why circular references should not be possible for beans that have a custom scope. Therefor this seems clearly a bug.

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              iterator Dirk Scheffler
              Last updater:
              Juergen Hoeller
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 39 weeks, 3 days ago