Spring Framework
  1. Spring Framework
  2. SPR-5481

MBeanExporter's autodetection incompatible with prototype beans

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major 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.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            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:
              5 years, 10 weeks, 2 days ago