You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrapped Guava collections don't deserialize properly anymore. This used to work in 2.9.10 but doesn't work in 2.10.4 anymore. For example the following code fails due to com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
Setting defaultSetterInfo seems to pay a meaningful role in the bug, also it happens only with Guava collections. Normal List works fine.
As a result you get:
Exception in thread "main" com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot create empty instance of [collection type; class com.google.common.collect.ImmutableList, contains [simple type, class java.lang.String]], no default Creator
at [Source: (String)"{"lists":[]}"; line: 1, column: 1]
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1592)
at com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase.getEmptyValue(ContainerDeserializerBase.java:149)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer._findNullProvider(StdDeserializer.java:1167)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.findContentNullProvider(StdDeserializer.java:1115)
at com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer.createContextual(GuavaCollectionDeserializer.java:80)
at com.fasterxml.jackson.databind.DeserializationContext.handlePrimaryContextualization(DeserializationContext.java:653)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:502)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293)
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:479)
at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4405)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4214)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182)
at JacksonTest.main(JacksonTest.java:18)
Yes, this sounds like regression of some kind, thank you for reporting it.
One thing you can try is to see if 2.11.1 works better. I will try to have a look at this issue in near future.
Wrapped Guava collections don't deserialize properly anymore. This used to work in 2.9.10 but doesn't work in 2.10.4 anymore. For example the following code fails due to
com.fasterxml.jackson.databind.exc.InvalidDefinitionException
:Setting
defaultSetterInfo
seems to pay a meaningful role in the bug, also it happens only with Guava collections. NormalList
works fine.As a result you get:
Full example code is available at https://github.com/ari-talja-rovio/jackson-example
The text was updated successfully, but these errors were encountered: