Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1

后端 未结 5 1474
感情败类
感情败类 2020-12-12 19:14

My JDK 9+181 Spring Boot 2.0.0.BUILD-SNAPSHOT CLI application displays this warning on startup:

WARNING: An illegal reflective access operation has occurred
         


        
5条回答
  •  北海茫月
    2020-12-12 19:51

    In JDK 9+, add the following option to the JVM to disable the warning from Spring's use of CGLIB:

    --add-opens java.base/java.lang=ALL-UNNAMED
    

    for example:

    java --add-opens java.base/java.lang=ALL-UNNAMED -jar target/*.jar
    

    No need to report it; it's a known Spring bug.

    This happens because the new JDK 9 module system detected an illegal access that will be disallowed sometime in the (near) future. You can read more about the JDK 9 Module system here.

    Update:

    A fix for this issue is available JDK 9+ with Spring 5.1+.

提交回复
热议问题