Skip to content

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

@raftheunis87

Description

@raftheunis87

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    closing-soonThis issue will close in 4 days unless further comments are made.dynamodb-local

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions