Closed ayoubAnbara closed 9 months ago
Hi @ayoubAnbara, thanks for taking the time to write in. As you can see by searching this issue tracker, Spring Boot's pom has been causing a similar binary-compatibility issue as it forcibly overwrites the version of okhttp and its dependencies. This SDK's latest version expects the following versions (or other versions that are binary compatible with). So, could you try explicitly specifying these versions in your pom.xml or build.gradle?
If the kotlin version is the only cause of this issue, we may consider switching to an old enough version for smoother adoption in Spring Boot apps. However, if the cause is okhttp/okio, we won't change our current policies. The reason why we depend on the latest version is to resolve publicly reported security issues.
I hope this clarifies.
Hi @seratch , Could you please mention which artifact id of Kotlin should I use in my pom.xml? It is this:
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.9.20</version>
</dependency>
As you can find here, the depedency must be:
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.8.21</version>
<scope>compile</scope>
</dependency>
EDIT: If the difference of the kotlin version (1.8 vs 1.9) is causing the issue, we will downgrade the kotlin minor version in future releases.
I discovered that there is a dependency on my pom.xml that has as transitive dependency okhttp com.squareup.okhttp:okhttp:2.7.5
not okhttp3
I tested slack-api with just spring boot 3.2.0 starters and it works fine. If you know any method to force slack-api to use their own transitive dependencies without upgrading dependency okhttp in the other dependency, please let me know. thank you @seratch for your assistance.
Reproducible in:
[INFO] - com.slack.api:slack-api-client:jar:1.36.1:compile [INFO] +- com.slack.api:slack-api-model:jar:1.36.1:compile openjdk version "21" 2023-09-19 LTS OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS) OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode, sharing) zsh: command not found: sw_vers
The Slack SDK version
[INFO] - com.slack.api:slack-api-client:jar:1.36.1:compile [INFO] +- com.slack.api:slack-api-model:jar:1.36.1:compile
Java Runtime version
openjdk version "21" 2023-09-19 LTS OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS) OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode, sharing)
OS info
output of cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.3 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., pom.xml/build.gradle))
I use Spring Boot 3.2.0 with Java 21, when I call
Slack slack = Slack.getInstance();
, it throw an exception which isjava.lang.NoSuchFieldError
Expected result:
Getting instance of class Slack
Actual result: