Uploaded image for project: 'Spring JavaConfig'
  1. Spring JavaConfig
  2. SJC-263

@ComponentScan annotation does not honor Lazy setting on @Configuration

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0.0.M4
    • Fix Version/s: None
    • Component/s: Public API
    • Labels:
      None
    • Environment:
      Windows XP

      Description

      The @ComponentScan annotation does not honor the defaultLazy setting in the declaring @Configuration. In the example below, @Component-annotated beans in somepackage.beans get created eagerly even though the @Configuration has defaultLazy set to TRUE.

      @Configuration(defaultLazy = Lazy.TRUE)
      @ComponentScan( "somepackage.beans")
      public class AppConfig {
      }

      In contrast, the default-lazy-init attribute in <beans> element is honored by <context:component-scan> element when working with XML configuration files.

        Attachments

          Activity

            People

            Assignee:
            cbeams Chris Beams
            Reporter:
            sprusr24 Shoaib Hannani
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: