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"])

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 io7m
, 10 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
via GitHub by io7m
, 6 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
via GitHub by zvozin
, 11 months ago
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]
via Stack Overflow by AlmuHS
, 9 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]
via GitHub by v1ctor
, 1 year ago
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]
via GitHub by v1ctor
, 6 months ago
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]
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 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 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.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
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)

Users with the same issue

7 times, 4 days ago
7 times, 1 week ago
5 times, 1 week ago
2 times, 1 week ago
4 times, 3 weeks ago

Write tip

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