Announcement Announcement Module
No announcement yet.
InitializingBean negate lazy-init="true" ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • InitializingBean negate lazy-init="true" ?


    I've noticed that a bean configured with lazy-init="true" is always being loaded, even if it's not referenced by any other bean.

    The bean in question extends SqlMapClientDaoSupport which implements the fact that it implements this interface causing it to ignore the lazy initialization?

    Is there any other way around this? We have properties that determine what beans to load. Loading this bean typically causes errors so at the moment we are just removing it from the configuration, which is not very seamless.


  • #2
    You must have been injected your lazy bean into a bean which is not lazy load ie. lazy-init="false" ( which is default ) that might causeing negation of lazy-init.

    InitializingBean will not cause negate of lazy init


    • #3
      I haven't. If this was the case then when I remove the lazy bean I'd receive an error based on any other dependencies.
      At the moment when I remove the lazy bean no errors are thrown.


      • #4
        In my case it is working just fine . I am using Spring 2.5.6

        Can you please put your context file configurations and your java file code