0

我正在尝试编写一个 Spring Boot 应用程序 (Gradle),它将通过云连接器从 S/4Hana 本地系统中查询数据。

仅供参考:我已经运行了 Java (Maven) 应用程序(来自 SAP 的示例),它运行良好。所以我的云设置应该没问题

当我将 Spring Boot 应用程序部署到 Cloud Foundry 时,我收到以下错误消息:

   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT ***************************
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT APPLICATION FAILED TO START
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT ***************************
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT Description:
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT An attempt was made to call a method that does not exist. The attempt was made from the following location:
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT     com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfDestinationLoader.<clinit>(ScpCfDestinationLoader.java:53)
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT The following method did not exist:
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT     com.sap.cloud.sdk.cloudplatform.cache.CacheManager.register(Lcom/github/benmanes/caffeine/cache/Cache;)Lcom/github/benmanes/caffeine/cache/Cache;
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT The method's class, com.sap.cloud.sdk.cloudplatform.cache.CacheManager, is available from the following locations:
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT     jar:file:/home/vcap/app/BOOT-INF/lib/caching-2.22.0.jar!/com/sap/cloud/sdk/cloudplatform/cache/CacheManager.class
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT     jar:file:/home/vcap/app/BOOT-INF/lib/caching-3.9.0.jar!/com/sap/cloud/sdk/cloudplatform/cache/CacheManager.class
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT It was loaded from the following location:
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT     jar:file:/home/vcap/app/BOOT-INF/lib/caching-2.22.0.jar!/
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT Action:
   2019-12-18T13:58:34.26+0100 [APP/PROC/WEB/0] OUT Correct the classpath of your application so that it contains a single, compatible version of com.sap.cloud.sdk.cloudplatform.cache.CacheManager
   2019-12-18T13:58:34.39+0100 [APP/PROC/WEB/0] OUT Exit status 1

我的 Spring Boot 应用程序类是这样配置的: 在此处输入图像描述

我正在使用这些 gradle 依赖项:

  compile "com.sap.cloud.sdk.cloudplatform:scp-cf:3.9.0"
  compile "com.sap.cloud.sdk.s4hana:s4hana-all:3.9.0"
  compile "com.sap.cloud.sdk.cloudplatform:caching:3.9.0"
  compile "com.sap.cloud.sdk.cloudplatform:security-servlet:3.9.0"

manifest.yml 看起来像这样: 在此处输入图像描述

我是否缺少一些依赖项或者 *.yml 错误?

4

1 回答 1

0

好的,我找到了原因,但我不明白,为什么这是一个问题:如果我使用:

DestinationAccessor.tryGetDestination("myDestination")

我得到错误!当我尝试到达目的地时

DestinationAccessor.getDestination("myDestination")

没有问题!

于 2019-12-19T07:15:45.363 回答