com.fasterxml.jackson.databind.JsonMappingException: Can not find a (Map) Key deserializer for type [simple type, class com.test.testjackson.testjackson.TestJackson$CompoundKey] at [Source: {"mapProperty":["java.util.HashMap",{"Compound|Key":"Value"}]}; line: 1, column: 37] (through reference chain: com.test.testjackson.testjackson.TestClass["mapProperty"])

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Try indicating constructor to use @JsonCreator annotation.

,

You are trying to deserialize a type for which Jackson does not provide a default mapper. You should create your custom mapper for this type.

Solutions on the web

via GitHub by OlegZhukov
, 1 year ago
Can not find a (Map) Key deserializer for type [simple type, class com.test.testjackson.testjackson.TestJackson$CompoundKey] at [Source: {"mapProperty":["java.util.HashMap",{"Compound|Key":"Value"}]}; line: 1, column: 37] (through reference chain: com.test.testjackson.testjackson.TestClass["mapProperty"])
via Stack Overflow by Jagger
, 1 year ago
Can not find a (Map) Key deserializer for type [simple type, class com.example.Matchday] at [Source: java.io.ByteArrayInputStream@bbc1e0; line: 1, column: 1]
via GitHub by PawelJagus
, 11 months ago
Can not find a (Map) Key deserializer for type [simple type, class com.example.Matchday] at [Source: java.io.ByteArrayInputStream@bbc1e0; line: 1, column: 1]
via GitHub by benestr
, 9 months ago
Can not find a (Map) Key deserializer for type [simple type, class kotlin.Pair<java.lang.String,java.lang.String>] at [Source: {"map":{"(string1, string2)":"string3"}}; line: 1, column: 1]
via Stack Overflow by James O&#39;Reilly
, 7 months ago
Can not deserialize instance of file.readers.TestAcceptanceCriteria out of START_ARRAY token at [Source: results\acceptanceCriteria.json; line: 1, column: 1]
via Google Groups by Anuj Kumar, 7 months ago
No _valueDeserializer assigned at [Source: [ { "name": "admin", "person_z": [ { "name": "admin" } ] }]; line: 3, column: 41] (through reference chain: java.util.ArrayList[0]->com.example.Person["person_z"]->java.util.HashSet[0]->com.example.Person["name"])
com.fasterxml.jackson.databind.JsonMappingException: Can not find a (Map) Key deserializer for type [simple type, class com.test.testjackson.testjackson.TestJackson$CompoundKey] at [Source: {"mapProperty":["java.util.HashMap",{"Compound|Key":"Value"}]}; line: 1, column: 37] (through reference chain: com.test.testjackson.testjackson.TestClass["mapProperty"])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:261)
at com.fasterxml.jackson.databind.DeserializationContext.reportMappingException(DeserializationContext.java:1234)
at com.fasterxml.jackson.databind.deser.DeserializerCache._handleUnknownKeyDeserializer(DeserializerCache.java:588)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findKeyDeserializer(DeserializerCache.java:168)
at com.fasterxml.jackson.databind.DeserializationContext.findKeyDeserializer(DeserializationContext.java:499)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.createContextual(MapDeserializer.java:237)
at com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:681)
at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:445)
at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:188)
at com.fasterxml.jackson.databind.jsontype.impl.AsArrayTypeDeserializer._deserialize(AsArrayTypeDeserializer.java:97)
at com.fasterxml.jackson.databind.jsontype.impl.AsArrayTypeDeserializer.deserializeTypedFromObject(AsArrayTypeDeserializer.java:61)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserializeWithType(MapDeserializer.java:387)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:497)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:511)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:396)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1196)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:314)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:148)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3789)
at com.test.testjackson.testjackson.TestJackson.testFails(TestJackson.java:34)

Users with the same issue

12 times, 6 months ago
Once, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
3 times, 1 month ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.