Skip to content

DynamoDB Local conflicts with Kotlin #4213

@vgiguere

Description

@vgiguere

Describe the bug

DynamoDBLocal-1.X and 2.0 come compiled with overrides of kotlin classes defined in kotlin core libs. It creates conflicts and prevents DynamoDBLocal from being used in Kotlin applications.

Similar issues have been opened on this in the past, it was decided not to fix it.

I am kindly asking to reconsider this decision because it is blocking kotlin users, which is a fast growing community, from using DynamoDBLocal in their kotlin apps for integration tests etc. I work for a major client of AWS and it is impacting us.

The error we get is:

`
An attempt was made to call a method that does not exist. The attempt was made from the following location:

aws.smithy.kotlin.runtime.http.operation.SerializeHandler.call(SdkOperationExecution.kt:396)

The following method did not exist:

'long kotlin.time.TimeSource$Monotonic.markNow-z9LOYto()'

The calling method's class, aws.smithy.kotlin.runtime.http.operation.SerializeHandler, was loaded from the following location:

jar:file:/xxx/.m2/repository/aws/smithy/kotlin/http-client-jvm/0.22.1/http-client-jvm-0.22.1.jar!/aws/smithy/kotlin/runtime/http/operation/SerializeHandler.class

The called method's class, kotlin.time.TimeSource$Monotonic, is available from the following locations:

jar:file:/xxx/.m2/repository/com/amazonaws/DynamoDBLocal/2.0.0/DynamoDBLocal-2.0.0.jar!/kotlin/time/TimeSource$Monotonic.class
jar:file:/xxx/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.8.21/kotlin-stdlib-1.8.21.jar!/kotlin/time/TimeSource$Monotonic.class

`

Can you simply do as suggested by @rafalwrzeszcz in this now defunct thread: #2487 and create 2 distributions of DynamoDBLocal.jar

  • One uber jar with the embedded kotlin class overrides
  • One smaller without the kotlin classes

That would be very much appreciated ;)

Expected Behavior

I expect to be able to use DynamoDBLocal-2.X in a kotlin application that packages the kotlin-stdlib-X.jar in its class path for integration tests without running into this unrecoverable error:

Current Behavior

`
An attempt was made to call a method that does not exist. The attempt was made from the following location:

aws.smithy.kotlin.runtime.http.operation.SerializeHandler.call(SdkOperationExecution.kt:396)

The following method did not exist:

'long kotlin.time.TimeSource$Monotonic.markNow-z9LOYto()'

The calling method's class, aws.smithy.kotlin.runtime.http.operation.SerializeHandler, was loaded from the following location:

jar:file:/xxx/.m2/repository/aws/smithy/kotlin/http-client-jvm/0.22.1/http-client-jvm-0.22.1.jar!/aws/smithy/kotlin/runtime/http/operation/SerializeHandler.class

The called method's class, kotlin.time.TimeSource$Monotonic, is available from the following locations:

jar:file:/xxx/.m2/repository/com/amazonaws/DynamoDBLocal/2.0.0/DynamoDBLocal-2.0.0.jar!/kotlin/time/TimeSource$Monotonic.class
jar:file:/xxx/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.8.21/kotlin-stdlib-1.8.21.jar!/kotlin/time/TimeSource$Monotonic.class

`

Reproduction Steps

Build integration tests on a kotlin application that is dependant on kotlin-stdlib and on DynamoDBLocal

Possible Solution

As suggested by use @rafalwrzeszcz in this now defunct thread: #2487 :

Create 2 distributions of DynamoDBLocal.jar

  • One uber jar with the embedded kotlin class overrides
  • One smaller without the kotlin classes

Additional Information/Context

No response

AWS Java SDK version used

latest

JDK version used

java 17, Kotlin 1.8

Operating System and version

Mac OS 13.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    dynamodb-localfeature-requestA feature should be added or improved.p3This is a minor priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions