Best Tomcat maintainers,

I would like to report the following warning message.

When redeploy a web application, there will be a warning message like this:






*WARNING: An illegal reflective access operation has occurredWARNING:
Illegal reflective access by
org.apache.catalina.loader.WebappClassLoaderBase to field
java.io.ObjectStreamClass$Caches.localDescsWARNING: Please consider
reporting this to the maintainers of
org.apache.catalina.loader.WebappClassLoaderBaseWARNING: Use
--illegal-access=warn to enable warnings of further illegal reflective
access operationsWARNING: All illegal access operations will be denied in a
future release*

I have already debugged it and find the message happens only *java 11*.

In WebappClassLoaderBase class: clearReferencesObjectStreamClassCaches()
-> clearCache(clazz, "localDescs") -> f.setAccessible(true);

in java 11, The f (java.lang.reflect.Field) setAccessible overrides its
superclass, which contains the following check:
if (flag) checkCanSetAccessible(Reflection.getCallerClass());

And this check results the above warning messages.


Best regards,

Hua

Reply via email to