jackson-databind: "Conflicting setter definitions for property" exception for `Map` subtype during deserialization
I’ve been deserializing Spring’s HttpHeaders
without issue until I upgraded to latests Spring 2.3.0
which upgraded Jackson from 2.10.3
to 2.11
.
After the upgrade to Jackson 2.11
I get this exception when trying to deserialize an HttpHeaders
object:
com.fasterxml.jackson.databind.JsonMappingException: Conflicting setter definitions for property "date": org.springframework.http.HttpHeaders#setDate(1 params) vs org.springframework.http.HttpHeaders#setDate(1 params)
(same can happen for lastModified
or any other overloaded setter)
There are 3 setDate
methods on HttpHeaders
.
It’s throw as part of POJOPropertyBuilder#getSetter()
I’ve traced it back to this change in POJOPropertiesCollector as part of #2555
I couldn’t find any way to disable indexing. #2555 is hinting that there isn’t one:
It may become necessary to allow NOT doing this, too (via MapperFeature), but let’s start by assumption that index should be used.
I’m wondering if the indexing change broke backward compatibility.
Version exhibiting behavior: 2.11
Last working version (that I tried): 2.10.4
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 17 (12 by maintainers)
Commits related to this issue
- Fixed #2757 — committed to FasterXML/jackson-databind by cowtowncoder 4 years ago
This bug is back on v2.12.6: