awslabs / amazon-dynamodb-local-samples

This is a sample Java project that demonstrates how to use DynamoDB Local for local development and testing
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
MIT No Attribution
15 stars 9 forks source link

DynamoDBLocal 2.1.0 does not work with spring-boot-starter-data-jpa 3.1.4 because of mismatching antlr4 versions #5

Closed raftheunis87 closed 8 months ago

raftheunis87 commented 1 year ago

Describe the bug

When creating a project that is using both the DynamoDBLocal 2.1.0 and the spring-boot-starter-data-jpa 3.1.4 dependencies, there is an error because of mismatching antlr4 versions.

It looks like DynamoDBLocal 2.1.0 is using antlr4 4.5.1, while spring-boot-starter-data-jpa is using antlr4 4.10.1.

Expected Behavior

Update DynamoDBLocal to use antlr 4.10.1 so that it works together nicely with the latest version of spring boot 3.

Current Behavior

11:22:48.935 [qtp861623840-26] INFO com.amazonaws.services.dynamodbv2.local.server.LocalDynamoDBServerHandler -- accessKey: dummyAccessKey  eu-west-1
11:22:48.935 [qtp861623840-26] INFO com.amazonaws.services.dynamodbv2.local.server.LocalDynamoDBServerHandler -- target: Query
ANTLR Tool version 4.5.1 used for code generation does not match the current runtime version 4.10.1
ANTLR Runtime version 4.5 used for parser compilation does not match the current runtime version 4.10.1
11:22:48.953 [qtp861623840-26] WARN org.eclipse.jetty.server.HttpChannel -- handleException / java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
11:22:48.984 [qtp861623840-18] INFO com.amazonaws.services.dynamodbv2.local.server.LocalDynamoDBServerHandler -- accessKey: dummyAccessKey  eu-west-1
11:22:48.984 [qtp861623840-18] INFO com.amazonaws.services.dynamodbv2.local.server.LocalDynamoDBServerHandler -- target: Query
11:22:48.985 [qtp861623840-18] WARN org.eclipse.jetty.server.HttpChannel -- /
java.lang.NoClassDefFoundError: Could not initialize class com.amazon.dynamodb.grammar.DynamoDbGrammarLexer

Reproduction Steps

Create a new spring boot project, include spring-boot-starter-data-jpa (3.1.4) and DynamoDBLocal 2.1.0 as dependencies.

Possible Solution

Regenerate DynamoDBLocal code with antlr4 4.10.1 and release a new version of DynamoDBLocal.

Additional Information/Context

No response

AWS Java SDK version used

2.20.162

JDK version used

17

Operating System and version

macOS 13.6

shetsa-amzn commented 1 year ago

We appreciate your feedback and we are currently reviewing this. We will update as soon as we have more information about next steps.

raftheunis87 commented 1 year ago

any update on this?

DmitryLobachov commented 12 months ago

Our team has been migrating to Spring Boot 3 and encountered this issue. Currently, this is a blocker that prevents us from moving forward. I'd really appreciate any updates on this 🙏

jeroenvandevelde commented 11 months ago

Made a reproducible test of this issue, https://github.com/jeroenvandevelde/dynamodb-local-antlr4

cembilgin commented 10 months ago

Any updates on this issue? Currently, it blocks our migration to Quarkus 3 that uses hibernate 6 It is not just related to spring boot. It is related to antlr dependency collision between hibernate-core(antlr4 4.10.1) and DynamoDBLocal(antlr4 4.5) Please, give update on this.

shetsa-amzn commented 10 months ago

Hi, we currently have this planned in our issues backlog. We do not have an ETA, but it is being prioritized. We will provide a status update once this is in progress.

bolodecenouracomcafe commented 9 months ago

Same here.

jerry-cherry commented 9 months ago

Is ETA available for this?

shetsa-amzn commented 8 months ago

Hello Customers,

@raftheunis87 @DmitryLobachov @jeroenvandevelde @cembilgin @bolodecenouracomcafe @jerry-cherry

The DynamoDB DevEx team is continuously making improvements to DynamoDB local. As we have received feedback from you as a user of DynamoDB local as a Maven dependency. Our latest improvement to DynamoDB local is an upgrade to Jetty 12 to be compatible with Spring Boot 3.2.0. This also includes the change for antlr4 upgrade to 4.10.1. We are reaching out to you to see if you would like to participate in the early testing of our DynamoDB local beta version, which includes this upgrade. We would really appreciate your support as your participation will help us ensure high quality user experience with this upgrade before we launch to the general public.

If you would like to participate in early testing of our DynamoDB local beta release, please send us an email at: aws-ddblocal-feedback@amazon.com.

Regards, The DynamoDB DevEx Team

bolodecenouracomcafe commented 8 months ago

Thank you, @shetsa-amzn. I'm glad to help out. I'll send the email shortly.

Just for your information, I'm currently using Quarkus (version 3.6.4) with the quarkus-amazon-lambda plugin and Java 17.

shetsa-amzn commented 8 months ago

Today, we are excited to announce that DynamoDB local for Amazon DynamoDB upgrades to Jetty 12 and JDK 17. We recommend that you run the latest version (2.3.0) of DynamoDB local to utilize the most recent updates and features of DynamoDB local for your development and testing use cases. This change also contains upgrade for ANTLR4 to 4.10.1

https://aws.amazon.com/about-aws/whats-new/2024/03/amazon-dynamodb-local-upgrades-jetty-12-jdk-17/