An illegal-access warning may appear when starting the servlet container (i.e. Tomcat) using JDK12+ :
...
INFO: WELD-ENV-000020: Using jandex for bean discovery
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.weld.util.bytecode.ClassFileUtils$1 (file:../WeldIllegalAccessWarn/WebContent/WEB-INF/lib/weld-core-impl-3.1.1.Final.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of org.jboss.weld.util.bytecode.ClassFileUtils$1
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
...
Note that this warning does not appear if setting the JDK runtime with the parameter --add-opens=java.base/java.lang=ALL-UNNAMED
Attached a war file with a simple web app to reproduce the problem + log file
- is duplicated by
-
WELD-2654 Illegal reflective access warning appears using JDK11
- Resolved