when is a spring bean instantiated

Assuming the bean is a singleton, and isn’t configured for lazy initialisation, then it’s created when the context is started up. getBean() just fishes it out.

Lazy-init beans will only be initialised when first referenced, but this is not the default. Scoped beans (e.g. prototype-scoped) will also only be created when first referenced.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)