"Conflicting setter definitions for property" exception for `Map` subtype during deserialization
See original GitHub issueI’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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:17 (12 by maintainers)
Top GitHub Comments
This bug is back on v2.12.6:
@bratwurzt this may look similar but it is probably not exactly the same as the regression test added with the fix (
MapDeser2757Test
) still passes. What’d be needed is a new reproduction (failing unit test) and new issue.