aws / aws-sdk-java-v2

The official AWS SDK for Java - Version 2
Apache License 2.0
2.17k stars 840 forks source link

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

Closed raftheunis87 closed 11 months ago

raftheunis87 commented 11 months ago

Describe the bug

When creating a project that is using both the DynamoDBLocal 2.0.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.0.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 1.20.0 as dependencies.

Possible Solution

Regenerate DynamoDBLocal code with antlr4 4.10.1.

Additional Information/Context

No response

AWS Java SDK version used

2.20.162

JDK version used

17

Operating System and version

macOS 13.6

raftheunis87 commented 11 months ago

@debora-ito, I'm tagging you here as I noticed you did follow-up previous DynamoDBLocal tickets, and I assume this is actually only a couple of minutes of work to publish a new version that uses antlr4 4.10.1.

Is there btw a specific reason why DynamoDBLocal is closed source?

debora-ito commented 11 months ago

@raftheunis87 the DynamoDBLocal library is not maintained by the Java SDK team, so we don't know what's the effort to make the dependency change.

The DynamoDBLocal team asked that issues with DynamoDBLocal should be open at https://github.com/awslabs/amazon-dynamodb-local-samples, they are tracking that repo directly. I can't transfer the issue unfortunately, so you'll need to create a new one.

raftheunis87 commented 11 months ago

Thanks @debora-ito for the information. I have created an issue on that repo: https://github.com/awslabs/amazon-dynamodb-local-samples/issues/5

This issue can be closed then.

github-actions[bot] commented 11 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.