Search code examples
javanoclassdeffounderror

java.lang.NoClassDefFoundError: com.github.fge.jackson.JsonLoader


I am using github project 'json-schema-validator' and getting below error.

java.lang.NoClassDefFoundError: com.github.fge.jackson.JsonLoader
at ****************.getJsonNode(Service.java:63)
at ****************.getSchemaNode(Service.java:69)
at ****************.isJsonValid(Service.java:93)
at ****************.requestToSectionJSON(Controller.java:477)

I added jar files same as the github project.. but I don't know why it keeps getting this lib error.

(ignore *** part. it just my package name)

  • jackson-coreutils 1.9
  • json-schema-core 1.2.10
  • jackson-core 2.9.6
  • jackson-databind 2.9.6
  • jackson-annotation 2.9.6
  • msg-simple 1.1
  • btf 1.2
  • GUABA 16.0.1
  • json-schema-validator 2.2.10
  • joda-time 2.9.7
  • uri-template 0.9
  • RHINO 1.7.7.1
  • libphonenumber 8.0.0
  • jsr305 3.0.1
  • activation 1.1.1
  • mailapi 1.4.3
  • jotp simple 5.0.3

Solution

  • Most of the times this error happens if you have wrong version of jars at runtime. Make sure you are using proper version of jackson-coreutils.jar (same version you used while compiling the code).