首页 > 解决方案 > Spring Boot - org.springframework.cglib.core.ReflectUtils 的非法反射访问 $1

问题描述

我对使用 Spring Boot 的 Spring Application 有疑问。

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/User/.m2/repository/org/springframework/spring-core/5.0.5.RELEASE/spring-core-5.0.5.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$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

我有 JDK 9.0,Spring Boot 2.0.4.RELEASE(现在我将依赖项更改为 2.0.5.RELEASE,但 Spring Core 没有实现。我看到 Spring Core 是 5.0.9。

问题是什么?

标签: spring-boot

解决方案


我对 Spring Boot 2.1.12 也有同样的问题。删除org.springframework.boot:spring-boot-devtools依赖项为我解决了这个问题。这似乎是一个已知问题(根据我发现的几个 GitHub 问题。


推荐阅读