当前位置: 首页 > 知识库问答 >
问题:

Impex old pk在将自定义组件导入内容槽时格式错误

龙俊良
2023-03-14

我试图在Hybris 6.4中创建一个impex脚本,以便通过Hybris管理控制台中的impex导入工具将自定义组件放入ContentSlot。当我运行impex时,我得到的是,old pk的格式错误:“catalogVersion(catalogVersion.catalog(catalog.id[default=contentcatalog])”,类型代码不是整数。[HY--1]错误。我已经使用BackOffice应用程序来验证我的自定义组件是否存在。我需要做什么才能将我的组件分配到ContentSlot,而不会遇到旧pk的错误格式:“catalogVersion(catalogVersion.catalog(catalog.id[default=contentcatalog])”,类型代码不是整数。[HY--1]错误?

这是我的弹劾。

<header line is blank>
$contentCatalog=apparel-ukContentCatalog
$catalogVersion=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Online])[default=$contentCatalog:Online]
INSERT_UPDATE ContentSlot;$catalogVersion;uid[unique=true];active;cmsComponents(uid, catalogVersion)
;;SearchResultsGridSlot;true;MyComponent:$catalogVersion

请注意,我还尝试了$catalogVersion宏的这种变体:

$catalogVersion=catalogversion(catalog(id[default=$contentCatalog]),version[default='Online'])[unique=true,default=$contentCatalog:Online]

这是弹劾尝试的堆栈跟踪。

ERROR [hybrisHTTP27] (000002C5) [CronJobErrorHandler] line 5 at main script: Exception ocurred, will ignore: de.hybris.platform.impex.jalo.ImpExException: old pk has wrong format: 'catalogVersion(CatalogVersion.catalog(Catalog.id[default=apparel-ukContentCatalog])', type code is not an integer.[HY--1]
de.hybris.platform.impex.jalo.ImpExException: old pk has wrong format: 'catalogVersion(CatalogVersion.catalog(Catalog.id[default=apparel-ukContentCatalog])', type code is not an integer.
    at de.hybris.platform.impex.jalo.imp.DefaultImportProcessor.processInsertUpdateLine(DefaultImportProcessor.java:483) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.DefaultImportProcessor.processItemData_Impl(DefaultImportProcessor.java:259) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.DefaultImportProcessor.processItemData(DefaultImportProcessor.java:158) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.ImpExImportReader.processLine(ImpExImportReader.java:718) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.ImpExImportReader.readLine(ImpExImportReader.java:518) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.Importer.doImport(Importer.java:251) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.Importer.importNextInternal(Importer.java:757) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.Importer.importNext(Importer.java:738) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.cronjob.ImpExImportJob.doImport(ImpExImportJob.java:290) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.cronjob.ImpExImportJob.performJob(ImpExImportJob.java:248) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.cronjob.ImpExImportJob.performCronJob(ImpExImportJob.java:115) [impexserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.execute(Job.java:1390) [processingserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:814) [processingserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:732) [processingserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.perform(Job.java:644) [processingserver.jar:?]
    at de.hybris.platform.servicelayer.cronjob.impl.DefaultCronJobService.performCronJob(DefaultCronJobService.java:86) [processingserver.jar:?]
    at de.hybris.platform.servicelayer.impex.impl.DefaultImportService.importData(DefaultImportService.java:437) [impexserver.jar:?]
    at de.hybris.platform.servicelayer.impex.impl.DefaultImportService.importDataUsingStandardImpex(DefaultImportService.java:360) [impexserver.jar:?]
    at de.hybris.platform.servicelayer.impex.impl.DefaultImportService.importData(DefaultImportService.java:104) [impexserver.jar:?]
    at de.hybris.platform.hac.facade.impl.DefaultImpexFacade.importData(DefaultImpexFacade.java:60) [classes/:?]
    at de.hybris.platform.hac.controller.console.ImpexController.handleImpexImportContent(ImpexController.java:189) [classes/:?]

为了进一步调查,我尝试从$catalogVersion宏定义中删除unique属性,以查看是否可以找到任何线索,但这里遇到的错误似乎支持了在$catalogVersion宏中存在unique key属性的必要性。

Impex没有catalogVersion的唯一属性

<header line is blank>
$contentCatalog=apparel-ukContentCatalog
$catalogVersion=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Online])[default=$contentCatalog:Online]
INSERT_UPDATE ContentSlot;$catalogVersion;uid[unique=true];active;cmsComponents(uid, catalogVersion)
;;SearchResultsGridSlot;true;MyComponent:$catalogVersion

无唯一属性的impex堆栈跟踪

ERROR [hybrisHTTP29] (000002C4) [CronJobErrorHandler] line 5 at main script: Exception ocurred, will ignore: de.hybris.platform.impex.jalo.imp.AmbiguousItemException: More than one item of type ContentSlot found for unique qualifiers {uid2=SearchResultsGridSlot}[HY-0]
de.hybris.platform.impex.jalo.imp.AmbiguousItemException: More than one item of type ContentSlot found for unique qualifiers {uid2=SearchResultsGridSlot}
    at de.hybris.platform.impex.jalo.imp.DefaultExistingItemResolver.resolveByQuery(DefaultExistingItemResolver.java:204) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.DefaultExistingItemResolver.findExisting(DefaultExistingItemResolver.java:133) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.DefaultImportProcessor.processItemData_Impl(DefaultImportProcessor.java:213) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.DefaultImportProcessor.processItemData(DefaultImportProcessor.java:158) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.ImpExImportReader.processLine(ImpExImportReader.java:718) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.imp.ImpExImportReader.readLine(ImpExImportReader.java:518) ~[impexserver.jar:?]
    at de.hybris.platform.impex.jalo.Importer.doImport(Importer.java:251) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.Importer.importNextInternal(Importer.java:757) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.Importer.importNext(Importer.java:738) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.cronjob.ImpExImportJob.doImport(ImpExImportJob.java:290) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.cronjob.ImpExImportJob.performJob(ImpExImportJob.java:248) [impexserver.jar:?]
    at de.hybris.platform.impex.jalo.cronjob.ImpExImportJob.performCronJob(ImpExImportJob.java:115) [impexserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.execute(Job.java:1390) [processingserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:814) [processingserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:732) [processingserver.jar:?]
    at de.hybris.platform.cronjob.jalo.Job.perform(Job.java:644) [processingserver.jar:?]
    at de.hybris.platform.servicelayer.cronjob.impl.DefaultCronJobService.performCronJob(DefaultCronJobService.java:86) [processingserver.jar:?]
    at de.hybris.platform.servicelayer.impex.impl.DefaultImportService.importData(DefaultImportService.java:437) [impexserver.jar:?]
    at de.hybris.platform.servicelayer.impex.impl.DefaultImportService.importDataUsingStandardImpex(DefaultImportService.java:360) [impexserver.jar:?]
    at de.hybris.platform.servicelayer.impex.impl.DefaultImportService.importData(DefaultImportService.java:104) [impexserver.jar:?]
    at de.hybris.platform.hac.facade.impl.DefaultImpexFacade.importData(DefaultImpexFacade.java:60) [classes/:?]
    at de.hybris.platform.hac.controller.console.ImpexController.handleImpexImportContent(ImpexController.java:189) [classes/:?]

共有1个答案

韦阳辉
2023-03-14

您的目录行与示例不同。您可以尝试下面的代码。

$contentCatalog=apparel-ukContentCatalog
$catalogVersion=catalogversion(catalog(id[default=$contentCatalog]),version[default=Online])[unique=true,default=$contentCatalog:Online]
INSERT_UPDATE ContentSlot;$catalogVersion;uid[unique=true];active;cmsComponents(uid, $catalogVersion)
;;SearchResultsGridSlot;true;MyComponent

在标准系统中为这个插槽工作。

$contentCatalog=apparel-ukContentCatalog
$catalogVersion=catalogversion(catalog(id[default=$contentCatalog]),version[default=Online])[unique=true,default=$contentCatalog:Online]
INSERT_UPDATE ContentSlot;$catalogVersion;uid[unique=true];active;cmsComponents(uid, $catalogVersion)
;;SearchResultsGridSlot;true;SearchResultsGrid
 类似资料:
  • 问题内容: 我创建了由名称的库这是在我的程序作为 并输出如下功能 当我在主程序中使用库时 尝试使用构建时出现以下错误 奇怪的是,库文件libfastget.a位于pkg文件夹中。 问题答案: 您需要使函数的名称可以大写导出: 用作: 规范中提到:“ 导出的标识符 ”: 标识符可以被导出以允许从另一个包访问它。如果同时满足以下条件,则导出标识符 标识符名称的第一个字符是Unicode大写字母(Uni

  • 问题内容: 我被赋予创建自定义摆幅组件的任务。我的组件在包含JSlider的测试应用程序中正常运行,该应用程序用于放大和缩小Image。但是,我需要以Model,UIDelegate和Component类格式显示自定义组件,而我完全迷失了如何转换代码以使其遵循这种格式。这是我的测试应用程序的代码。 以下代码是我需要遵循的类格式 组件类别 型号CLass UIDelegate类 我将以这种格式实现自

  • 我正在构建一个 Spring 启动独立应用程序,该应用程序需要使用来自远程服务器的消息并将其写入 。我正在使用Flume嵌入式代理来可靠地记录消息。但是我收到以下错误。 引起:org.apache.flume.Flume异常:组件类型的com.security.flume.sink.Sy 根据文档仅支持。这是否意味着我们甚至不能编写自定义水槽? 我对Flume相当陌生。我真的很感谢你在这个问题上的

  • 您可以将自定义、ASP.NET、JSP、JRun 标签导入 Dreamweaver 中,使其成为创作环境的组成部分。 您可以将自定义标签导入 Dreamweaver 中,使其成为创作环境的组成部分。例如,当您在“代码”视图中开始键入导入的自定义标签时,就会出现代码提示菜单,列出该标签的属性供您选择。 从 XML 文件导入标签 您可以从 XML 文档类型定义 (DTD) 文件或架构导入标签。 打开标