Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use external type + type id resolver #406

Closed
cowtowncoder opened this issue Feb 14, 2014 · 1 comment
Closed

Cannot use external type + type id resolver #406

cowtowncoder opened this issue Feb 14, 2014 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

(moved from https://jira.codehaus.org/browse/JACKSON-912 submitted by martint)


It fails with the following exception when trying to deserialize a json string:

Exception in thread "main" java.lang.IllegalStateException: Do not know how to construct standard type id resolver for idType: CUSTOM
at com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.idResolver(StdTypeResolverBuilder.java:213)
at com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.buildTypeDeserializer(StdTypeResolverBuilder.java:102)
at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findPropertyTypeDeserializer(BasicDeserializerFactory.java:1246)
at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.resolveType(BasicDeserializerFactory.java:1426)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.constructSettableProperty(BeanDeserializerFactory.java:735)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:562)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:267)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:171)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:388)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:143)
at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:342)
at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:2895)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2789)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1943)
at TestJson.main(TestJson.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

See this for a test case: https://gist.github.com/martint/9005047

cowtowncoder added a commit that referenced this issue Feb 14, 2014
cowtowncoder added a commit that referenced this issue Feb 14, 2014
@cowtowncoder cowtowncoder added this to the 2.2 milestone Feb 14, 2014
@cowtowncoder
Copy link
Member Author

Turns out the only problem here was inability to use @JsonTypeIdResolver (and @JsonTypeResolver) on properties. This will be fixed for 2.3.2 and 2.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant