On 23/04/2020 10:49, Hua Zhang wrote: > 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:
Yes we know. It is intentional. Mark > *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 > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org