Have two bean definitions:
file a.xml
<bean id="A" class="com.A">
<property name="bClass" ref="B"/>
</bean>
file b.xml
<bean id="B" class="com.B"/>
In some cases file b.xml does not contain definition of bean B.
And from other side,file a.xml always contains link to B definition.
How to define reference to B bean to be optional, in order to avoid org.springframework.beans.factory.NoSuchBeanDefinitionException
@Autowired(required=false) helped