Behavior does sound like a concurrency problem, but I do not recall anything specific that should cause it. I do know there have been fixes to some concurrency issues related to type resolution so this could be the root cause. There are no currently open bug reports for this, as far as I know.
The very first thing to do is to upgrade to the latest 2.5 patch -- 2.5.5 -- and see if the problem still persists. If that does not help, I would recommend upgrading to later minor versions; and I would expect the problem to be resolved, either with 2.6.7 or 2.7.7. If 2.5.5 does not help, I would try upgrade straight to 2.7.7 if at all possible; I don't think there are significant bug fixes in this area for 2.8 (but there are in 2.7). I hope this helps, -+ Tatu +- On Tue, Sep 6, 2016 at 5:52 PM, alex via jackson-user < [email protected]> wrote: > 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. > -- 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.
