1

I have a 3rd party jar library with some POJOs. I want to deserialize them with jackson.

Some of the fields have a double setter, like:

public void setValue(Value value) {
    this.value = value.getValue();
}

public void setValue(String value) {
    this.value = value;
}

These setters cause jackson to throw java.lang.IllegalArgumentException: Conflicting setter definitions for property ....

Currently I'm ignoring one setter at a time using jackson mixin, but there are so many of these setters that I'm writing as much code as the actual POJO at this point.

Is there a way to ignore ALL setters that have an argument of type Value?

andrew
  • 3,879
  • 4
  • 25
  • 43
  • 1
    I can not reproduce your issue. This works for me. Can you please share a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) so we can reproduce it? – Samuel Philipp Jul 10 '19 at 16:46
  • 1
    Possible duplicate of [Deserializing JSON into object with overloaded methods using Jackson](https://stackoverflow.com/questions/6346018/deserializing-json-into-object-with-overloaded-methods-using-jackson) – Nikolai Shevchenko Jul 10 '19 at 16:48
  • Do you use [fasterxml](https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind) implementation or [codehaus](https://mvnrepository.com/artifact/org.codehaus.jackson)? – Michał Ziober Jul 10 '19 at 21:26

0 Answers0