【发布时间】:2021-01-08 08:31:29
【问题描述】:
我想通过 odata-generator-cli 3.35.0 在 Java 中创建一个 OData 客户端。
使用 .edmx 和关注 Service from Business Hub 的 swagger 文件。
正在生成 OData 客户端,但出现异常:
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.ODataToVdmGenerator - Processing 1 OData service...
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.ODataToVdmGenerator - Processing OData service 'Integration Content' at /cpi/api/v1
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type IntegrationDesigntimeArtifact from set IntegrationDesigntimeArtifacts
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type RuntimeArtifactErrorInformation from set RuntimeArtifactErrorInformations
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type Configuration from set Configurations
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type Resource from set Resources
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type IntegrationRuntimeArtifact from set IntegrationRuntimeArtifacts
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamingContext - Found more than one occurrence of the Java identifier type. The new identifier has been renamed to type_2
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type IntegrationPackage from set IntegrationPackages
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type ServiceEndpoint from set ServiceEndpoints
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type EntryPoint from set EntryPoints
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamingContext - Found more than one occurrence of the Java identifier type. The new identifier has been renamed to type_2
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type Definition from set APIDefinitions
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type ValueMappingDesigntimeArtifact from set ValueMappingDesigntimeArtifacts
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator - Found entity type ValMapSchema from set ValMapSchema
[main] WARN com.sap.cloud.sdk.datamodel.odata.generator.ODataToVdmGenerator - Error in file IntegrationContent; unable to generate all VDM classes.
com.sap.cloud.sdk.datamodel.odata.generator.ODataGeneratorReadException: org.apache.olingo.odata2.api.edm.EdmException: An exception occurred.
at com.sap.cloud.sdk.datamodel.odata.generator.EdmService$TypedAdapter.getType(EdmService.java:317)
at com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator.processNavigationProperties(NamespaceClassGenerator.java:1098)
at com.sap.cloud.sdk.datamodel.odata.generator.NamespaceClassGenerator.processEntitySet(NamespaceClassGenerator.java:891)
at com.sap.cloud.sdk.datamodel.odata.generator.EntitySetProcessor.processEntitySets(EntitySetProcessor.java:74)
at com.sap.cloud.sdk.datamodel.odata.generator.CodeModelClassGenerator.processService(CodeModelClassGenerator.java:102)
at com.sap.cloud.sdk.datamodel.odata.generator.ODataToVdmGenerator.createCodeModelForServices(ODataToVdmGenerator.java:133)
at com.sap.cloud.sdk.datamodel.odata.generator.ODataToVdmGenerator.generate(ODataToVdmGenerator.java:98)
at com.sap.cloud.sdk.datamodel.odata.generator.DataModelGenerator.execute(DataModelGenerator.java:797)
at com.sap.cloud.sdk.datamodel.odata.generator.DataModelGeneratorCli.run(DataModelGeneratorCli.java:206)
at com.sap.cloud.sdk.datamodel.odata.generator.DataModelGeneratorCli.main(DataModelGeneratorCli.java:188)
Caused by: org.apache.olingo.odata2.api.edm.EdmException: An exception occurred.
at org.apache.olingo.odata2.core.edm.provider.EdmAssociationEndImplProv.getEntityType(EdmAssociationEndImplProv.java:51)
at org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv.getType(EdmNavigationPropertyImplProv.java:44)
at com.sap.cloud.sdk.datamodel.odata.generator.EdmService$TypedAdapter.getType(EdmService.java:314)
... 9 more
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.ODataToVdmGenerator - Generating Java classes to C:\Users\W4ff3l\Downloads\odata-gen\trg
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.DataModelGeneratorCli - ------------------------------------------------------------
[main] WARN com.sap.cloud.sdk.datamodel.odata.generator.DataModelGeneratorCli - Generator SUCCEEDED but had the following 1 warning messages:
[main] WARN com.sap.cloud.sdk.datamodel.odata.generator.DataModelGeneratorCli - Error in file IntegrationContent; unable to generate all VDM classes.
[main] INFO com.sap.cloud.sdk.datamodel.odata.generator.DataModelGeneratorCli - ------------------------------------------------------------
导航似乎有问题,但我不知道如何调试或解决这个问题。
要复制问题,请从 Business Hub 下载 .edmx 和 .json 并在生成器中使用它们。
【问题讨论】:
-
感谢您报告此事。我现在正尝试在我的系统上重现此异常,以便进一步探索。
-
我可以重现该问题,到目前为止,我的观察是元数据文档中未定义实体类型“com.sap.hci.api.ValMap”。一旦我有更多信息,将在这里更新。
标签: sap-cloud-sdk