当我停止使用Tomcat 9和Java10的SpringBoot Web应用程序时,非法的反射访问
2022-09-04 03:40:14
我正在尝试使用Spring Boot 2开发Java 10,但我遇到了一些问题。
该应用程序是一个基于Spring Boot 2的简单Web应用程序。应用程序启动正常,但是当我停止它时,我收到以下警告:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/C:/Users/CS/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.11/tomcat-embed-core-9.0.11.jar) to field java.io.ObjectStreamClass$Caches.localDescs
WARNING: Please consider reporting this to the maintainers of org.apache.catalina.loader.WebappClassLoaderBase
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
如您所见,我已经将嵌入的Tomcat服务器从版本8切换到9.0.11,以符合Java模块系统。应用程序通过以下选项启动--add-opens java.base/java.lang=ALL-UNNAMED
有谁知道为什么我会收到此消息?