我正在尝试使用Spring Boot 2进行Java 10开发,遇到了一些问题。
该应用程序是基于Spring Boot 2的简单网络应用程序。应用程序启动正常,但当我停止它时,会出现以下警告:
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
启动的。
有人知道为什么我会收到这个消息吗?
--add-opens java.base/java.io=ALL-UNNAMED
。 - Johannes Kuhn