question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conflicting Kotlin versions for DynamoDB local `1.16.0`

See original GitHub issue

As indicated in the post to another issue, we are facing conflicts when using the latest DynamoDB local version 1.16.0 in a Kotlin project. The reason is that the DynamoDB local jar seems to contain a copy of the Kotlin standard lib which conflicts with the one we are using for our project. We tested this both with a 1.4.x and 1.5.x version of Kotlin and both failed. Can you please fix the setup so that we can use Kotlin and DynamoDB local, again?


@zoewangg Thanks for the information about the release of 1.16.0. We were successfully able to start an embedded DynamoDB local instance in a JUnit test. However, once we now face some compiler warning:

w: Some JAR files in the classpath have the Kotlin Runtime library bundled into them. This may cause difficult to debug problems if there's a different version of the Kotlin Runtime library in the classpath. Consider removing these libraries from the classpath
w: /home/markus/.gradle/caches/modules-2/files-2.1/com.amazonaws/DynamoDBLocal/1.16.0/f705aa07cee4eb8199e70a393c5bd8173e7290ac/DynamoDBLocal-1.16.0.jar: Library has Kotlin runtime bundled into it

Moreover, all integration tests fail due to conflicting Kotlin standard library files, see the following error details:

***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
    kotlin.reflect.jvm.internal.impl.descriptors.Visibilities.<clinit>(Visibilities.kt:56)
The following method did not exist:
    'java.util.Map kotlin.collections.MapsKt.createMapBuilder()'
The method's class, kotlin.collections.MapsKt, is available from the following locations:
    jar:file:/home/markus/.gradle/caches/modules-2/files-2.1/com.amazonaws/DynamoDBLocal/1.16.0/f705aa07cee4eb8199e70a393c5bd8173e7290ac/DynamoDBLocal-1.16.0.jar!/kotlin/collections/MapsKt.class
    jar:file:/home/markus/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.0/29dae2501ca094416d15af0e21470cb634780444/kotlin-stdlib-1.5.0.jar!/kotlin/collections/MapsKt.class
The class hierarchy was loaded from the following locations:
    kotlin.collections.MapsKt: file:/home/markus/.gradle/caches/modules-2/files-2.1/com.amazonaws/DynamoDBLocal/1.16.0/f705aa07cee4eb8199e70a393c5bd8173e7290ac/DynamoDBLocal-1.16.0.jar
    kotlin.collections.MapsKt___MapsKt: file:/home/markus/.gradle/caches/modules-2/files-2.1/com.amazonaws/DynamoDBLocal/1.16.0/f705aa07cee4eb8199e70a393c5bd8173e7290ac/DynamoDBLocal-1.16.0.jar
    kotlin.collections.MapsKt__MapsKt: file:/home/markus/.gradle/caches/modules-2/files-2.1/com.amazonaws/DynamoDBLocal/1.16.0/f705aa07cee4eb8199e70a393c5bd8173e7290ac/DynamoDBLocal-1.16.0.jar
    kotlin.collections.MapsKt__MapsJVMKt: file:/home/markus/.gradle/caches/modules-2/files-2.1/com.amazonaws/DynamoDBLocal/1.16.0/f705aa07cee4eb8199e70a393c5bd8173e7290ac/DynamoDBLocal-1.16.0.jar
    kotlin.collections.MapsKt__MapWithDefaultKt: file:/home/markus/.gradle/caches/modules-2/files-2.1/com.amazonaws/DynamoDBLocal/1.16.0/f705aa07cee4eb8199e70a393c5bd8173e7290ac/DynamoDBLocal-1.16.0.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of kotlin.collections.MapsKt

Can you help us with the issue or guide us towrads a collegue that can provide more information?

We are using Kotlin 1.5, AWS SDK 2, Spring Boot, Corretto 11 as JRE, Gradle. Moreover, it seems like the DynamoDB local jar contains indeed a copy of the Kotlin standard library classes/files. Is it possible to remove those from the bundle?

_Originally posted by @spanierm in https://github.com/aws/aws-sdk-java-v2/issues/982#issuecomment-843235519_

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:32
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
rafalwrzeszczcommented, Aug 20, 2021

I assume the Kotlin SDK is bundled to allow stand-alone running of the .jar? Why not create separate jars - one for inclusion as dependency, and uber-jar for stand-alone calls?

4reactions
aeskreis-tacommented, Jun 29, 2022

Bumping this. Still not working and this workaround is absurd. Please create a jar that is compatibile with Kotlin projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conflicting Kotlin versions for DynamoDB local `1.16.0`
As indicated in the post to another issue, we are facing conflicts when using the latest DynamoDB local version 1.16.0 in a Kotlin...
Read more >
Kotlin version conflict when using Kotlin Gradle plugins in pre ...
This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong. User Agreement Review now...
Read more >
Amazon DynamoDB Local - unknown error, exception or failure
There are at least 2 problems with DynamoDBLocal. Resolve both, and you will be running embedded DynamoDB. First, the -port parameter does not...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
local dynamodb commit (2226a406) - GitLab
Except for the rights explicitly granted to you in this License Agreement, all right, title and interest in the Software are reserved and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found