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
It works fine for me in java where as in scala i am getting the below exception. Please let me know how can i resolve this?
val jsonContent ="""{"test":"113123","myList":{"test2":"321323"}}"""
val mapData = mapper.readValue(jsonContent, classOf[Map[String,String]])
Error:
com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of scala.collection.immutable.Map, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
at [Source: java.io.StringReader@603b1d04; line: 1, column: 1]
The text was updated successfully, but these errors were encountered:
It looks like you didn't add the Scala module to the object mapper. Without the module, Jackson doesn't know how to deserialize the Scala collection class scala.collection.immutable.Map, because it doesn't implement any of the Java collection interfaces.
It works fine for me in java where as in scala i am getting the below exception. Please let me know how can i resolve this?
val jsonContent ="""{"test":"113123","myList":{"test2":"321323"}}"""
val mapData = mapper.readValue(jsonContent, classOf[Map[String,String]])
Error:
com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of scala.collection.immutable.Map, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
at [Source: java.io.StringReader@603b1d04; line: 1, column: 1]
The text was updated successfully, but these errors were encountered: