使用Cloud SDK 3.9.0在S4Hana内部部署的Spring Boot应用程序

问题描述 投票:0回答:1

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

仅供参考:我已经在运行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错误?

sdk cloud sap cloudfoundry sap-cloud-platform
1个回答
0
投票

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

DestinationAccessor.tryGetDestination("myDestination")

我得到了错误!当我尝试使用

到达目的地时
DestinationAccessor.getDestination("myDestination")

没有问题!

© www.soinside.com 2019 - 2024. All rights reserved.