InvalidDefinitionException after upgrading from 2.9.1 to 2.9.2
See original GitHub issueThis is (re)submission of https://github.com/FasterXML/jackson-databind/issues/1817 after @cowtowncoder asked me to submit it here.
I’m using Kotlin and I’ve just upgraded from Jackson version 2.9.1 to 2.9.2. Previously the following was working:
val parsed = jsonMapper.readValue(result.output, DockerHealthCheckStatus::class.java)
But now it fails with the following exception:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Invalid definition for property `Log` (of type `batect.docker.DockerClient$DockerHealthCheckStatus`): Could not find creator property with name 'Log' (known Creator properties: [log])
at [Source: (String)"{
"Status": "unhealthy",
"FailingStreak": 130,
"Log": [
{
"Start": "2017-10-04T00:54:23.608075352Z",
"End": "2017-10-04T00:54:23.646606606Z",
"ExitCode": 1,
"Output": "something went wrong"
"[truncated 87 chars]; line: 1, column: 1]
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:62)
at com.fasterxml.jackson.databind.DeserializationContext.reportBadPropertyDefinition(DeserializationContext.java:1446)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:607)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:269)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:179)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:411)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:477)
at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4178)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3997)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2992)
at batect.docker.DockerClient.getLastHealthCheckResult(DockerClient.kt:249)
Parser is set up with:
private val jsonMapper by lazy {
val mapper = jacksonObjectMapper()
mapper.propertyNamingStrategy = PropertyNamingStrategy.UPPER_CAMEL_CASE
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
mapper
}
DockerHealthCheckStatus
is defined as:
private data class DockerHealthCheckStatus(val log: List<DockerHealthCheckResult>)
Am I doing something wrong or is this a bug introduced in 2.9.2?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:11 (4 by maintainers)
Top Results From Across the Web
InvalidDefinitionException after upgrading from 2.9.1 to 2.9.2
I'm using Kotlin and I've just upgraded from Jackson version 2.9.1 to 2.9.2. Previously the following was working: val parsed = jsonMapper.
Read more >Unable to start application after upgrading jackson-databind ...
I am working on a spring boot application, I want to upgrade jackson-databind from 2.9.10.2 to 2.10.2. Below is snippet from my pom.xml...
Read more >Duplicate proprety ID with Jackson 2.9.2+ - Google Groups
After upgrading Jackson to 2.9.5 (which Dw uses), Jackson (since 2.9.2) ... InvalidDefinitionException: Duplicate creator property "id" (index 0 vs 1) at ...
Read more >Upgrade to latest OO version from previous versions
When you upgrade to Operations Orchestration 2019.11, this installs the trial version. Install a commercial license within 90 days.
Read more >DeserializationContext (jackson-databind 2.9.9 API) - Javadoc.io
Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@apatrida I can confirm that this bug is also affecting single-constructor data class with a parameter other than a string. In my case, the class holds a single
UUID?
property:The class definition is:
If I add an explicit
@JsonProperty
annotation or add a dummy empty property the binding works as expected.I think all issues mentioned here are resolved in current releases (or master branch of this plugin)