0

We are currently using the following bom for sap cloud sdk . This is in line with the bom that is supposed to be used with the CAP NG stack

<dependency>
                <groupId>com.sap.cloud.sdk</groupId>
                <artifactId>sdk-modules-bom</artifactId>
                <version>3.11.0</version>
                <type>pom</type>
                <scope>import</scope>
</dependency>.

While running our application we get the following stack trace

[APP/PROC/WEB/0] OUT 2020-03-17 05:24:11.523 ERROR 13 --- [nio-8080-exec-3] c.s.c.a.o.v.p.impl.DataProvider          : com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement;
   2020-03-17T10:54:11.52+0530 [APP/PROC/WEB/0] OUT java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement;
   2020-03-17T10:54:11.52+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.security.AuthTokenRequest.extractAccessToken(AuthTokenRequest.java:114) ~[security-scp-cf-3.11.0.jar!/:na]
   2020-03-17T10:54:11.52+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.security.AuthTokenRequest.lambda$getXsuaaServiceToken$4eef0570$1(AuthTokenRequest.java:100) ~[security-scp-cf-3.11.0.jar!/:na]
   2020-03-17T10:54:11.52+0530 [APP/PROC/WEB/0] OUT     at io.vavr.control.Try.of(Try.java:75) ~[vavr-0.10.2.jar!/:na]
   2020-03-17T10:54:11.52+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.security.AuthTokenRequest.getXsuaaServiceToken(AuthTokenRequest.java:81) ~[security-scp-cf-3.11.0.jar!/:na]
   2020-03-17T10:54:11.52+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.security.AuthTokenRequest.getXsuaaServiceToken(AuthTokenRequest.java:75) ~[security-scp-cf-3.11.0.jar!/:na]
   2020-03-17T10:54:11.52+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.security.DefaultAuthTokenFacade.lambda$tryGetXsuaaServiceToken$ca2e0d2c$1(DefaultAuthTokenFacade.java:77) ~[security-scp-cf-3.11.0.jar!/:na]

We have also added the gson dependency to our pom, but this did not resolve the issue

<dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.5</version>
</dependency>
Florian Wilhelm
  • 600
  • 4
  • 17
Anirban Das
  • 107
  • 7

1 Answers1

2

The SAP Cloud SDK for Java version 3.11.0 uses GSON version 2.8.6, see sdk-bom:3.11.0.

The following dependency can be declared:

<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.8.6</version>
</dependency>

Let me know if you need help with configuring a conflict-free POM.

Alexander Dümont
  • 903
  • 1
  • 5
  • 9