Issue with Jackson ObjectMapper after version upgrade | Community
Skip to main content
Level 3
December 4, 2023
Solved

Issue with Jackson ObjectMapper after version upgrade

  • December 4, 2023
  • 2 replies
  • 12706 views

Good morning all,

We are upgrading our current project's AEM SDK version (AEMaaCS) from 2023.7.12697.20230713T151945Z-230601 to 2023.11.14227.20231108T162349Z-231100, however, when we do so, we are getting build errors when running unit tests against code that uses the Jackson ObjectMapper.  These errors are not present and the tests pass in the current project.  It is only when we upgrade the SDK version that we receive these errors.

 

This seems like a breaking change, but I don't see anything documented from Adobe on this.  Has anyone experienced this issue?  Any suggestions on a resolution?

 

The errors are below.  I have adjusted the namespace and class names purposefully.

 

java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMap$Builder
at com.project.project.core.models.ClassNameTest.setResponseFromJson(ClassNameTest.java:591)
at com.project.project.core.models.ClassNameTest.setUp(ClassNameTest.java:87)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.util.internal.PrivateMaxEntriesMap$Builder
at com.project.project.core.models.ClassNameTest.setResponseFromJson(ClassNameTest.java:591)
at com.project.project.core.models.ClassNameTest.setUp(ClassNameTest.java:87)

 

[ERROR] getCardPaths_setTag Time elapsed: 0.032 s <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.fasterxml.jackson.databind.ObjectMapper
at com.project.project.core.models.ClassNameTest.setResponseFromJson(ClassNameTest.java:591)
at com.project.project.core.models.ClassNameTest.setUp(ClassNameTest.java:87)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by leeasling1

Followup - I did this again, but changed "jackson-core" to "jackson-databind", and it works perfectly.

 

Thank you @estebanbustamante 

 

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>[2.12.3,)</version>
<scope>test</scope>
</dependency>

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 4, 2023

As for the resolution try to include the Jackson dependency in your POM with TEST scope, like below:

<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>[2.12.3,)</version> <scope>test</scope> </dependency>

Feel free to adjust the version you are using. In regards to the issue as a whole, there maybe some version change, that's my guess, but the above should solve it. 

Hope this helps

 

Esteban Bustamante
Level 3
December 4, 2023

Hi Esteban - I did try this before posting, and now for a second time with your response, and it does not work, I still receive the same errors, which is very strange.

kautuk_sahni
Community Manager
Community Manager
December 11, 2023

@leeasling1 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni