AEMaaCS AEM SDK2025.3.20133.20250325T063357Z-250300 jar fails with gson | Community
Skip to main content
Level 2
April 3, 2025
Solved

AEMaaCS AEM SDK2025.3.20133.20250325T063357Z-250300 jar fails with gson

  • April 3, 2025
  • 2 replies
  • 787 views

I have just upgraded our build to use the latest AEM SDK, however everything that uses JSON now fails to run with the following errors

 

java.lang.NoSuchMethodError: 'void com.google.gson.internal.ConstructorConstructor.<init>(java.util.Map, boolean)'
at com.google.gson.Gson.<init>(Gson.java:218)
at com.google.gson.Gson.<init>(Gson.java:195)
at com.merkle.xp.whitelabel.core.models.MerklePageImpl.getSeoSiteStructuredData(MerklePageImpl.java:310)
at com.merkle.xp.whitelabel.core.models.MerklePageImplTest.testSeoSiteWithNoSeoData(MerklePageImplTest.java:436)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
 
The code that does this is new Gson()
 
I can revert back to an older version, however I worry how this will work on the servers.

 

 

Best answer by sharma__g

Got the same issue earlier, I am assuming you are using GSON version 2.8.9 or older in your code. 

Update the version to [2.9.0] and test your code that uses GSON library. Everything should get fixed after this.

2 replies

konstantyn_diachenko
Community Advisor
Community Advisor
April 3, 2025

Hi @taggatmerkle ,

 

I would assume that you include com.google.code.gson dependency with newer version in your pom.xml.

 

Please check through the Package Dependencies (/system/console/depfinder) latest version that is provided within AEM SDK API dependency. If you bundle is importing another version, please update dependency version to one that is provided with AEM SDK API. 

 

Also double check deprecated API: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/release-notes/deprecated-removed-features 

 

Best regards,

Kostiantyn Diachenko.

Kostiantyn Diachenko, Community Advisor, Certified Senior AEM Developer, creator of free AEM VLT Tool, maintainer of AEM Tools plugin.
Level 2
April 4, 2025

Yes we did, but it seems to get ignored since the SDK has a version of gson in it.

 

To get around this i have removed GSON from all of our code and used ObjectMapper instead.

sharma__g
sharma__gAccepted solution
April 4, 2025

Got the same issue earlier, I am assuming you are using GSON version 2.8.9 or older in your code. 

Update the version to [2.9.0] and test your code that uses GSON library. Everything should get fixed after this.

kautuk_sahni
Community Manager
Community Manager
April 15, 2025

@taggatmerkle Did you find the suggestions helpful? If you need more information, please let us know. If a response resolved your issue, kindly mark it as correct to help others in the future. Alternatively, if you discovered a solution on your own, we'd appreciate it if you could share it with the community. Thank you!

Kautuk Sahni
Level 2
April 15, 2025

Yes the reply by sharma_g resolved the issue and everything is working as expected (thought i had marked it as correct but can't see that now)