Hybris OOTB bean没有被注入 [英] Hybris OOTB bean is not being injected
问题描述
调试中,我看到OOTB类的属性customPopulators:
Debugging , I see that the attribute customPopulators of OOTB class:
de.hybris.platform.cmsfacades.cmsitems.converter.DefaultCMSItemConverter
de.hybris.platform.cmsfacades.cmsitems.converter.DefaultCMSItemConverter
尽管已通过XML进行了很好的配置,但并未被注入(但是其他属性正在被注入).
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>
所以我需要以某种方式通过spring重新注入该属性,如何实现呢?
So I need to re-inject via spring in some way this attribute again , how can I achieve this ?
如果我们在hac-> groovy控制台中执行此脚本,我们将看到它是空的:
If we execute this script in the hac -> groovy console we will see that is empty:
推荐答案
据我所见,您的常规脚本正在检索另一个bean(即 defaultCmsRenderingCmsItemConverter ),而不是您为其提供定义的那个是 cmsItemConverter
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
这篇关于Hybris OOTB bean没有被注入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!