【问题标题】:SAP Hybris Assisted Service Module (ASM) - can't generate componentSAP Hybris 辅助服务模块 (ASM) - 无法生成组件
【发布时间】:2019-10-22 16:36:09
【问题描述】:

我已经在我的本地主机上成功安装并测试了 ASM(我们使用 Hybris 1811)。然后我想将它转移到我们的开发服务器上(实际上只是在localextensions.xml 中更改并重新生成了extensionsinfo.xml),所以在我的店面extensionsinfo.xml 中有这样注册的插件:

<requires-extension name="assistedservicestorefront "/>

但它不会在视图中生成文件:

[DefaultCMSComponentRendererRegistry] Error processing component tag. currentComponent [AssistedServiceComponentModel (8796814312508@2)] exception: 
File [&#47;WEB-INF&#47;views&#47;responsive&#47;cms&#47;assistedservicecomponent.jsp] not found

我已导入与安装 ASM 手册(来自 help.hybris.com)和本地主机(cms-content.impex 以包括组件和 Jsp)中相同的 .impex 文件。

即使我在 HAC 中运行更新,我也尝试同步内容目录。我检查了 HAC 中的扩展,它包含与我本地机器上相同的 ASM 扩展:assistedservicefacadesassistedserviceservicesassistedservicestorefront。 当我检查后台时,具有该 ID 的组件确实存在,并且在在线目录中。

如何生成这些文件?或者我应该以某种方式用我的自定义视图覆盖它们?但我认为这是不好的方法。

更新:我还尝试将此条目添加到我的店面的project.properties

sikob2cstorefront.additionalWebSpringConfigs.assistedservicestorefront=classpath\:/assistedservicestorefront/web/spring/assistedservicestorefront-web-spring.xml

但后来我收到了加载 bean 的错误:

Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultStorefrontTenantDefaultFilterChainList': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AssistedservicestorefrontFilterListMergeDirective' defined in class path resource [assistedservicestorefront/web/spring/assistedservicestorefront-web-spring.xml]: Cannot resolve reference to bean 'assistedServiceFilter' while setting add; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'assistedServiceFilter' defined in class path resource [assistedservicestorefront/web/spring/assistedservicestorefront-web-spring.xml]: Cannot resolve reference to bean 'assistedServicePathRestrictionEvaluator' while setting bean property 'assistedServicePathRestrictionEvaluator'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'assistedServicePathRestrictionEvaluator' available

【问题讨论】:

  • 您是否将assistedservicestorefront 安装为插件?
  • 是的,在我的本地机器上,我将它作为插件安装了 ant addoninstall -Daddonnames="assistedservicestorefront" -DaddonStorefront.yacceleratorstorefront="mystorefront",因此它更新了 extensionsinfo.xml,我可以在 hac 中看到扩展。
  • 因此您也需要在其他环境中运行相同的命令。让我详细添加答案。

标签: java hybris add-on


【解决方案1】:
# Install assistedservicestorefront
# Replace Mystorefront with your storefront extension name
ant addoninstall -Daddonnames="assistedservicestorefront" -DaddonStorefront.yacceleratorstorefront="Mystorefront"

我认为您错过了安装 assistedservicestorefront 插件,或者如果您已经安装,请检查您的服务器上是否发生了以下更改。

addoninstall 命令进行以下更改

  • 将 assistedservicestorefront 添加到店面扩展的 extensioninfo.xml 中

    喜欢 &lt;requires-extension name="assistedservicestorefront "/&gt;

  • 从 assistedservicestorefront 内的 project.properties.template 生成一个新的 project.properties 文件,该文件具有以下条目。

在以下属性中将 yacceleratorstorefront 替换为您的店面扩展名。

#Specifies the location of the spring context file added automatically to the global platform application context.
assistedservicestorefront.application-context=assistedservicestorefront-spring.xml

yacceleratorstorefront.additionalWebSpringConfigs.assistedservicestorefront=classpath:/assistedservicestorefront/web/spring/assistedservicestorefront-web-spring.xml


assistedservicestorefront.javascript.paths.mobile=/responsive/common/js/assistedservicestorefront.js;/responsive/common/js/jquery.tablesorter.pager.js;/responsive/common/js/jquery.tablesorter.min.js;/responsive/common/js/Chart.min.js;/responsive/common/js/asm.storefinder.js
assistedservicestorefront.javascript.paths.responsive=/responsive/common/js/assistedservicestorefront.js;/responsive/common/js/jquery.tablesorter.pager.js;/responsive/common/js/jquery.tablesorter.min.js;/responsive/common/js/Chart.min.js;/responsive/common/js/asm.storefinder.js

assistedservicestorefront.css.paths.mobile=/responsive/common/css/assistedservicestorefront.css;/responsive/common/css/storeFinder.css;/responsive/common/css/customer360.css
assistedservicestorefront.css.paths.responsive=/responsive/common/css/assistedservicestorefront.css;/responsive/common/css/storeFinder.css;/responsive/common/css/customer360.css

assistedservicestorefront.redirect.customer_and_cart=/cart
assistedservicestorefront.redirect.customer_only=/my-account
assistedservicestorefront.redirect.error=/
assistedservicestorefront.redirect.order=/my-account/order/%s

assistedservicestorefront.deeplink.link=/assisted-service/emulate

cscokpit.assistedservice.deeplink=true
assistedservicestorefront.profile.cookie.name=profile.tracking.pause

#AIF AJAX call timeout in milliseconds
assistedservicestorefront.aif.timeout=7000

因此,如果您不想在每个环境中运行 addoninstall 命令,则可以手动进行这两项更改。您可以参考插件中生成的 project.properties 文件,并将所有这些属性复制到店面的 project.properties 或 local.properteis 文件并提交更改。

【讨论】:

  • 请查看更新后的问题。我做了这两件事(根据需要添加扩展名和该属性),但随后上下文初始化失败,请参阅堆栈跟踪。也许还有一些其他的属性要添加?
  • 请参阅您本地系统中的 assistedservicestorefront project.properties 并尝试在 local.properties 中添加所有这些。不仅是额外的WebSpringConfigs。
  • 我觉得你不见了assistedservicestorefront.application-context=assistedservicestorefront-spring.xml
  • 我建议在您的服务器上运行 addonInstall 命令,就像您在本地和所有设置中所做的那样。在这种情况下,您不需要手动设置这些属性。是的,但您需要为每个新的 hybris 环境设置运行 addoninstall。
  • 将 ASM 扩展中的所有 project.properties 添加到我的店面扩展中完成了最后一件事,谢谢。
猜你喜欢
  • 2020-10-01
  • 1970-01-01
  • 2021-03-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多