getting NoClassDefFoundError using elastic4s getting NoClassDefFoundError using elastic4s elasticsearch elasticsearch

getting NoClassDefFoundError using elastic4s


Double check if you are importing elastic4s-jackson:

libraryDependencies += "com.sksamuel.elastic4s" %% "elastic4s-jackson" % "5.6.0" 


I have had the exact same issue with play 2.8 and elastic4s 6.7.3 using the jackson module tooWhat helped me was running evicted and looking at the dependencies each library had and figuring out why it cannot load that particular class . ultimately upgrading to 6.7.8 ended up resolving the issue.Also if you look in the buid.sbt file for the elasic4s project it lists all the versions it is using https://github.com/sksamuel/elastic4s/blob/master/build.sbt


You can use jackson-module-scala and exclude the com.fasterxml.jackson which is referenced in elastic4s-http and verify that com.fasterxml.jackson is available in the libraries/classpath when the application is running.