I'm using the latest 2.13.0 version of jackson, and when I try to parse a YAML file, I'm getting this exception
java.lang.NoSuchMethodError: 'com.fasterxml.jackson.core.io.ContentReference com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createContentReference(java.lang.Object)'
What could be the issue?
The dependencies that I've included are jackson-core, jackson-databind and jackson-dataformat-yaml - all 2.13.0
No such method errorin most cases means that you have have 2 dependencies that are the same but with different versions, however the application is loading the version that does not have this method in it,The reference to this
_createContentReferenceexists inYAMLFactoryinjackson-dataformat-yaml.jarThe actual
_createContentReferenceimplementation exists incom.fasterxml.jackson.core.JsonFactorywhich existsjackson-core.2.13.0.In your case, you probably have another
jackson-core.jarwith an older version as part of your indirect dependencies.You can see
mvn dependency:treeor your IDE (Such as Eclipse allows you to search for dependency by name, and it returns all that match, including their versions)