Does spring resolve property placeholders for lazy beans during context creation?

356 Views Asked by At

I have a bean definition like spring xml context file

<bean id="idFilter" class="some.package.app.filter.IdFilter" lazy-init="true">
    <constructor-arg type="java.lang.String" value="${id.start}"/>
</bean>

Does spring try to resolve the property ${id.start} while building context?

I would assume since idFilter is lazily loaded, the property id.start will not be tried for resolution till the bean is being used.

Is it right?

1

There are 1 best solutions below

0
On BEST ANSWER

After carefully debugging the code, I found that placeholders are resolved even for the lazy beans while creating bean definitions.

Please note, bean definitions are not bean instantiation.

So, if the placeholder is not found, an error is thrown for all beans regardless of bean being lazy or eager