Skip to content

bug: wrong version of jackson-databind in serialization module #1471

Description

@jeromevdl

According to the documentation on https://docs.powertools.aws.dev/lambda/java/utilities/serialization/, I have to:

a) Add the dependency:
implementation 'software.amazon.lambda:powertools-serialization:1.17.0'

b) Use the extractDataFrom method to serialize the object, like this:
extractDataFrom(event).as(Product.class);

I just started a fresh project, and importing powertools-serialization:1.17.0 brings along com.fasterxml.jackson.core:jackson-databind:2.9.9
image

Now, when I try to use it with a valid request:
image

There is a problem with EventPart.as, as it uses this line:
image

But the method readValue(String sourceContent. Class valueClazz) is not available on version 2.9.9 of the Jackson ObjectMapper, so I end up getting a “NoSuchMethod” exception:
image

Now, if I manually update the version of Jackson-databind to 2.12, this works perfectly:

Possible Solution

Enforce the jackson-databind dependency (2.15.2) in the serialization module so that maven does not take the transitive one from jmespath (2.9.9)

Environment

  • Powertools for AWS Lambda (Java) version used: 1.17.0
  • Packaging format (Layers, Maven/Gradle): gradle
  • AWS Lambda function runtime:
  • Debugging logs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency filegood-first-issueGood for newcomersmaven

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions