Hi,

I have an abstract class with generics, and annotated with @JsonTypeInfo 
and @JsonSubTypes, like so:

@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "someProperty"
)
@JsonSubTypes(
  {@JsonSubTypes.Type(value = Class1.class, name = "class1"),
   @JsonSubTypes.Type(value = Class2.class, name = "class2"})
public abstract class MyClass<T extends Other> {
...
}

All of the subclasses have the generic type statically declared. 
Deserializing almost always works, but very sporadically I get the 
following error:

Can not construct instance of MyClass , problem: abstract types either need 
to be mapped to concrete types, have custom deserializer, or be 
instantiated with additional type information.

I haven't been able to replicate this in a controlled test, but it has 
popped up in production. Is it possibly due to multi-threading?

I'm using jackson-annotations 2.5.1 and jackson-databind 2.5.1

Any help is appreciated,

Alex

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to