Hybris OOTB bean is not being injected

为君一笑 提交于 2020-01-05 08:29:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!