I'm getting an warning message when running my webapp on Tomcat 9 server using java 11.
Errors follows:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/C:/Users/<myuser>/Documents/Workspace2019-09/.metadata/.plugins/org.eclipse.wst.server.core/tmp8/wtpwebapps/myproject/WEB-INF/lib/guice-3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
I google it for this particular error, and found that adding the following to the VM arguments will resolve the warning.
--add-opens java.base/java.lang=ALL-UNNAMED
Is there an alternative to resolve this kind of error? Some suggest to debug it with the following. Who's responsible for maintaining com.google.inject.internal.cglib.core? How soon guice 3.0 won't be supported ?
--illegal-access=deny
The warning itself says to use the following:
--illegal-access=warn
