njava.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.xcontent.json.JsonXContent

Previously we were using 7.17.12 version of below dependency

org.elasticsearch
elasticsearch

But now when i update version from 7.17.12 to 8.6.1 or 8.8.2 i get below exception
Could not initialize class org.elasticsearch.xcontent.json.JsonXContent","exception":"\njava.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.xcontent.json.JsonXContent

this error comes up while trying to access toString method for searchSourceBuilder , SortBuilder & AbstractQueryBuilder. Also the class searchSourceBuilder is declared as final so the same could not extended to override its toString method. Can anyone please suggest how can we convert these models to string format.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.