Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeromevdl opened this issue Oct 11, 2023 · 0 comments · Fixed by #1472
Closed

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

jeromevdl opened this issue Oct 11, 2023 · 0 comments · Fixed by #1472
Labels
bug Something isn't working dependencies Pull requests that update a dependency file good-first-issue Good for newcomers maven priority:2 High - core feature or affects 60% of the users

Comments

@jeromevdl
Copy link
Contributor

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
@jeromevdl jeromevdl added bug Something isn't working good-first-issue Good for newcomers dependencies Pull requests that update a dependency file maven priority:2 High - core feature or affects 60% of the users labels Oct 11, 2023
@jeromevdl jeromevdl linked a pull request Oct 12, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file good-first-issue Good for newcomers maven priority:2 High - core feature or affects 60% of the users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant