Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object Mapper - YAMLFactory - exception due to missing _createContentReference method

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

like image 945
eja Avatar asked Mar 24 '26 20:03

eja


1 Answers

No such method error in 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 _createContentReference exists in YAMLFactory in jackson-dataformat-yaml.jar

The actual _createContentReference implementation exists in com.fasterxml.jackson.core.JsonFactory which exists jackson-core.2.13.0.

In your case, you probably have another jackson-core.jar with an older version as part of your indirect dependencies.

You can see mvn dependency:tree or your IDE (Such as Eclipse allows you to search for dependency by name, and it returns all that match, including their versions)

like image 170
JCompetence Avatar answered Mar 27 '26 10:03

JCompetence



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!