Hi,
I’m experiencing an issue when reloading POJO classes that are used to serialize/deserialize JSON with Jackson 2.7.0.
Symptoms include:
1. new fields not being recognised
2. NoSuchMethodError when removing fields
3. creating a new ObjectMapper instance does not fix it.
After some digging I found that the source of the problem is in com.fasterxml.jackson.databind.util.ClassUtil.
Seems like in 2.7 a static ClassMeta cache was added.
I created a temporary workaround. Before each ObjectMapper use, call this code:
Field field = ClassUtil.class.getDeclaredField("sCached");
field.setAccessible(true);
((LRUMap<Class<?>, ClassMetadata>) field.get(null)).clear();