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

MBeanExporter's autodetection incompatible with prototype beans

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.6
    • Fix Version/s: Waiting for Triage
    • Component/s: JMX
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      MBeanExporter#autodetect() method is supposed to register all the beans in the JMX server.
      It calls

      this.beanFactory.getBeanNamesForType(Object.class, true, this.allowEagerInit);
      

      which in turn returns all the bean names.

      If there's a bean defined with prototype scope, it will be included in the list, and MBeanExporter will run beanFactory.getBean(beanName) to get one instance. So an unrequested instance of a prototype bean would be created. Which is wrong.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              grzegorz.oledzki Grzegorz Olędzki
              Last updater:
              Chris Beams
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                9 years, 11 weeks, 6 days ago