com.fasterxml.jackson.databind.JsonMappingException

Can not construct instance of sample.immutables_javaslang_bug_20170112.Schema$Phone: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: {"title":"Mr","dob":[2017,1,12],"phones":[{"number":"555-55555"},{"number":"42-424242"}],"name":"John"}; line: 1, column: 43] (through reference chain: sample.immutables_javaslang_bug_20170112.PersonImpl$Json["phones"])


Samebug tips1

Try indicating constructor to use @JsonCreator annotation.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.


Solutions on the web1353

Solution icon of github
via GitHub by io7m
, 2 months ago
Can not construct instance of sample.immutables_javaslang_bug_20170112.Schema$Phone: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: {"title":"Mr","dob

Solution icon of github
via GitHub by io7m
, 7 months ago
Can not construct instance of sample.immutables_javaslang_bug_20170112.Schema$Phone: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: {"title":"Mr","dob

Solution icon of web
via qiita.com by Unknown author, 1 year ago
Can not construct instance of sample.jackson.AbstractClass, 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@2ef5e5e3; line: 1, column: 10] (through reference chain: sample.jackson.Dto["list"])

Solution icon of googlegroups
via Google Groups by Cemo, 1 month ago
Can not construct instance of xxx.PhotoConfiguration, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information at [Source: N/A; line: -1, column: -1] (through reference chain: xxx.MainConfiguration["photo"])

Solution icon of stackoverflow
Can not construct instance of MetricValueDescriptor, 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.ByteArrayInputStream@2ede2c9f; line: 1, column: 2] (through reference chain: SingleValueMetricImpl["descriptor"])

Solution icon of stackoverflow
Can not construct instance of java.io.Serializable, 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@6fd90825; line: 1, column: 2] (through reference chain: com.demo.jackson.AClass["id"])

Solution icon of github
Can not construct instance of com.mapkeen.DeserializationTest$I: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: {"type":"b", "b":1}; line: 1, column: 1]

Solution icon of github
Can not construct instance of com.spotify.google.cloud.pubsub.client.PullResponse: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: java.util.zip.GZIPInputStream@46a89674; line: 1, column: 1]

Solution icon of stackoverflow
via Stack Overflow by AlmuHS
, 5 months ago
Can not construct instance of cc.arduino.contributions.packages.ContributionsIndex: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: java.io.FileInputStream@62fdb4a6; line: 1, column: 1]

Solution icon of github
Can not construct instance of com.mapkeen.DeserializationTest$I: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: {"type":"b", "b":1}; line: 1, column: 1]

Stack trace

  • com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of sample.immutables_javaslang_bug_20170112.Schema$Phone: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: {"title":"Mr","dob":[2017,1,12],"phones":[{"number":"555-55555"},{"number":"42-424242"}],"name":"John"}; line: 1, column: 43] (through reference chain: sample.immutables_javaslang_bug_20170112.PersonImpl$Json["phones"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270) at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:1456) at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1012) at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:149) at javaslang.jackson.datatype.deserialize.ArrayDeserializer.deserialize(ArrayDeserializer.java:57) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:178) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:150) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1194) 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:3798) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2842) at sample.immutables_javaslang_bug_20170112.SampleTest.json_test(SampleTest.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 20 hours ago
21 times, 2 days ago
8 times, 2 days ago
Once, 2 weeks ago
5 times, 3 weeks ago
129 more bugmates