Skip to content

Commit a15418d

Browse files
authored
FFM-5928 - Fix java.lang.NoSuchMethodError caused by kotlin-stdlib (#127)
* FFM-5928 - Fix java.lang.NoSuchMethodError caused by conflicting versions of kotlin-stdlib on the classpath What Exclude kotlin-stdlib being brought in by mapdb. Minor fix to GettingStart example to stop it from closing the client too soon. Why okhttp 4.9.3 uses a newer version of the kotlin-stdlib which is conflicting with a version brought in by mapdb Testing Tested with GettingStarted java sample using same instructions as on the README
1 parent af1b20c commit a15418d

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The first step is to install the FF SDK as a dependency in your application usin
6969

7070
Refer to the [Harness Feature Flag Java Server SDK](https://mvnrepository.com/artifact/io.harness/ff-java-server-sdk) to identify the latest version for your build automation tool.
7171

72-
This section lists dependencies for Maven and Gradle and uses the 1.1.7 version as an example:
72+
This section lists dependencies for Maven and Gradle and uses the 1.1.8 version as an example:
7373

7474
#### Maven
7575

@@ -78,14 +78,14 @@ Add the following Maven dependency in your project's pom.xml file:
7878
<dependency>
7979
<groupId>io.harness</groupId>
8080
<artifactId>ff-java-server-sdk</artifactId>
81-
<version>1.1.7</version>
81+
<version>1.1.8</version>
8282
</dependency>
8383
```
8484

8585
#### Gradle
8686

8787
```
88-
implementation group: 'io.harness', name: 'ff-java-server-sdk', version: '1.1.7'
88+
implementation group: 'io.harness', name: 'ff-java-server-sdk', version: '1.1.8'
8989
```
9090

9191
### Code Sample

examples/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.harness.featureflags</groupId>
88
<artifactId>examples</artifactId>
9-
<version>1.1.8-SNAPSHOT</version>
9+
<version>1.1.8</version>
1010

1111
<properties>
1212
<maven.compiler.source>8</maven.compiler.source>
@@ -33,7 +33,7 @@
3333
<dependency>
3434
<groupId>io.harness</groupId>
3535
<artifactId>ff-java-server-sdk</artifactId>
36-
<version>1.1.8-SNAPSHOT</version>
36+
<version>1.1.8</version>
3737
</dependency>
3838

3939
<dependency>

examples/src/main/java/io/harness/ff/examples/GettingStarted.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@ public static void main(String[] args) {
3434
scheduler.scheduleAtFixedRate(
3535
() -> {
3636
boolean result = cfClient.boolVariation(flagName, target, false);
37-
System.out.println("Boolean variation is " + result);
37+
System.out.println("Flag '" + flagName + "' Boolean variation is " + result);
3838
},
3939
0,
4040
10,
4141
TimeUnit.SECONDS);
4242

43+
44+
TimeUnit.MINUTES.sleep(15);
45+
4346
// Close the SDK
47+
System.out.println("Cleaning up...");
48+
scheduler.shutdownNow();
4449
cfClient.close();
4550

4651
} catch (Exception e) {

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.harness</groupId>
88
<artifactId>ff-java-server-sdk</artifactId>
9-
<version>1.1.8-SNAPSHOT</version>
9+
<version>1.1.8</version>
1010
<packaging>jar</packaging>
1111
<name>Harness Feature Flag Java Server SDK</name>
1212
<description>Harness Feature Flag Java Server SDK</description>
@@ -150,6 +150,12 @@
150150
<groupId>org.mapdb</groupId>
151151
<artifactId>mapdb</artifactId>
152152
<version>3.0.8</version>
153+
<exclusions>
154+
<exclusion>
155+
<groupId>org.jetbrains.kotlin</groupId>
156+
<artifactId>kotlin-stdlib</artifactId>
157+
</exclusion>
158+
</exclusions>
153159
</dependency>
154160

155161
<dependency>

0 commit comments

Comments
 (0)