Found this thanks to @ddekany and his answer to a related issue in Freemarker removeIntrospectionInfo does not work with DCEVM after model fraud
The JVM (at least HotSpot 1.7) seems to cache the Introspector cache for ThreadGroup. This means that Introspector.flushCaches must be called in a thread that runs in the corresponding ThreadGroup .
When I completed this for all ThreadGroups in the application, everything worked correctly.
I could not find any documentation why java.beans.Introspector cached for ThreadGroup , so if anyone has reliable information, add a comment with a link.
Thanks.
Update:
Based on JDK7 source
public static BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException { if (!ReflectUtil.isPackageAccessible(beanClass)) { return (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo(); } ThreadGroupContext context = ThreadGroupContext.getContext(); BeanInfo beanInfo; synchronized (declaredMethodCache) { beanInfo = context.getBeanInfo(beanClass); } if (beanInfo == null) { beanInfo = new Introspector(beanClass, null, USE_ALL_BEANINFO).getBeanInfo(); synchronized (declaredMethodCache) { context.putBeanInfo(beanClass, beanInfo); } } return beanInfo; }
This is definitely added in JDK7 because I checked the JDK6 code and it does not exist!
source share