问题
Debugging , I see that the attribute customPopulators of OOTB class:
de.hybris.platform.cmsfacades.cmsitems.converter.DefaultCMSItemConverter
Isn't being injected (however the other attributes are being injected) despite of being well configured via XML.
<alias name="defaultCMSItemConverter" alias="cmsItemConverter"/>
<bean name="defaultCMSItemConverter" parent="baseCMSItemConverter">
<property name="attributeStrategyConverter" ref="cmsAttributeStrategyConverter"/>
<property name="attributeValueToRepresentationStrategy" ref="cmsAttributeValueToRepresentationStrategy" />
<property name="composedTypeToAttributeCollectionConverter" ref="cmsComposedTypeToAttributeCollectionConverter" />
<property name="customPopulators" ref="cmsItemConverterCustomPopulators" />
<property name="nestedOrPartOfAttributePredicate" ref="cmsNestedOrPartOfAttributePredicate" />
</bean>
So I need to re-inject via spring in some way this attribute again , how can I achieve this ?
If we execute this script in the hac -> groovy console we will see that is empty:
回答1:
From what I can see your groovy script is retrieving another bean(i.e defaultCmsRenderingCmsItemConverter) not the one for which you provided a definition which is cmsItemConverter
来源:https://stackoverflow.com/questions/59176963/hybris-ootb-bean-is-not-being-injected