I have the following 3 classes :
public class BaseClass<T>{
private List<T> someList;
... constructor.....
}
public class Class1 extends BaseClass<BasePerson>{ .. constructor.. }
public class Class2 extends BaseClass<Person> { ... constructor... }
When deserializing one of thew classes (Class1 or Class2) I get the following error:
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.somepackage.BasePerson
I saw some answers regarding this error, all advising using TypeReference
or TypeFactory
here:
answer
and here :
another answer
My problem is that i'm using jackson older version (1.9.2) and can't move to 2.0. Both TypeReference
and TypeFactory
were added in 2.0.0 API.
Anyone can advise what to do?