通过org.springframework.cglib.core.ReflectUtils非法反射访问$ 1

一月尼尔森:

我的JDK 9 + 181春季启动2.0.0.BUILD-快照CLI应用程序在启动时显示这样的警告:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/home/jan/src/fm-cli/target/fm-cli-0.1.0-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-5.0.0.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

这是一个控制台应用程序,所以我需要禁用此警告 - 我该怎么办呢?

注意:这个问题问的如何禁用此警告由Spring引发的具体问题; 它不是重复JDK9:发生非法反射访问操作。org.python.core.PySystemState哪些交易在不同库中的类似症状。

一月尼尔森:

在JDK 9+,下面的选项添加到JVM禁止从Spring的使用CGLIB的警告:

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

例如:

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

无需汇报; 这是一个已知的弹簧缺陷

这是因为新的JDK 9模块系统检测到非法的访问,将在(近)未来的某个时候被禁止。你可以阅读更多有关的JDK 9模块系统在这里

更新

针对此问题的解决方法是可用的JDK 9+与Spring 5.1+。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

具有Java 11引发的Spring Boot多模块项目无法访问类org.springframework.cglib.core.ReflectUtils

春季测试失败:java.lang.NoClassDefFoundError:org / springframework / cglib / transform / impl / MemorySafeUndeclaredThrowableStrategy

spring 无法访问列表 multipartfile 中的 org.springframework.core.io.Inputstreamsource

org.springframework.beans.factory.UnsatisfiedDependencyException 1

org.springframework.web.multipart.MultipartFile和org.springframework.core.io.Resource之间的转换

java.lang.NoClassDefFoundError:org / springframework / core / io /资源异常

org.springframework.core.convert.ConversionFailedException:无法从类型转换

org.springframework.core.task.TaskRejectedException同时监听SQS队列?

未知的引用性质:org.springframework.ide.eclipse.core.springnature

java.lang.ClassNotFoundException:org.springframework.core.io.Resource

java.lang.NoClassDefFoundError:org / springframework / core / JdkVersion

org.springframework.security.core.userdetails.UserDetails 创建用户

“org.springframework.kafka.core.ConsumerFactory”不能被发现

NoSuchMethodError:org.springframework.plugin.core.PluginRegistry.getPluginOrDefaultFor

java.lang.NoClassDefFoundError:org / springframework / core / env / ConfigurableEnvironment

坚持org.springframework.security.core.userdetails.User或UserDetails

JdbcBatchItemWriterBuilder 与 org.springframework.jdbc.core.jdbcTemplate.batchUpdate

为org.springframework.core.io.Resource对象分配名称

测试applicationContext:org.springframework.core.annotation.AnnotationUtils.getAnnotationAttributes

java.lang.NoClassDefFoundError:org / springframework / core / ResolvableType

org.springframework.orm.jpa.JpaSystemException:无法通过反射设置字段值[POST_INSERT_INDICATOR]值

ClassCastException: org.springframework.beans.factory.support.NullBean 不能转换为 org.springframework.plugin.core.Plugin

应用程序无法启动以下方法不存在:org.springframework.plugin.core.PluginRegistry.of(org.springframework.plugin.core.Plugin[])

无法将联系人投射到org.springframework.core.io.support.ResourceRegion

在Spring Security中如何初始化User-(org.springframework.security.core.userdetails.User)

java.lang.NoSuchMethodError org.springframework.core.annotation.AnnotationUtils.getAnnotation

由于org.springframework.core.ResolvableTypeProvider导致上下文初始化失败

考虑重温项以上或配置中的定义类型的豆“org.springframework.data.redis.core.RedisTemplate”

现场的JdbcTemplate需要类型的bean的org.springframework.jdbc.core.JdbcTemplate'不能被发现