【问题标题】:Spring boot - An illegal reflective access operation has occurredSpring boot - 发生了非法反射访问操作
【发布时间】:2021-08-29 13:47:07
【问题描述】:

我向我的演示应用程序添加了新的两个依赖项,即 spring 集成和 spring 集成文件。之后,我在控制台中收到以下警告。应用程序运行良好,但它困扰我。

我该如何解决这个问题?

WARNING: Illegal reflective access by org.springframework.util.ReflectionUtils (file:/C:/Users/TECH%20WORLD/.m2/repository/org/springframework/spring-core/5.3.7/spring-core-5.3.7.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)

我项目的 SDK 是 15.0.2 版本

春季启动版

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.0</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

添加的依赖项

<!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-core -->
<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-core</artifactId>
    <version>5.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-file -->
<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-file</artifactId>
    <version>5.5.0</version>
</dependency>

【问题讨论】:

  • 您添加了哪个 JAVA 版本和哪些依赖项?
  • @dassum 我已经用版本详细信息修改了我的主要问题。谢谢!
  • stackoverflow.com/questions/46671472/… 这能回答你的问题吗?

标签: spring-boot


【解决方案1】:

这个问题由下面的问题来回答! Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1

请注意,这是一个已知的 Spring 错误。

根据调查结果,发生这种情况是因为当新的 JDK 9 模块系统检测到将来可能会被禁止的非法访问时。

还有更多阅读... Java Platform, Standard Edition

【讨论】:

    猜你喜欢
    • 2019-09-02
    • 1970-01-01
    • 2018-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    • 1970-01-01
    相关资源
    最近更新 更多