MyBatis警告: WARNING: An illegal reflective access operation has occurred

编程知识 更新时间:2023-04-06 11:32:04

MyBatis警告: WARNING: An illegal reflective access operation has occurred

警告描述

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ibatis.reflection.Reflector (file:/C:/Users/XXX/.m2/repository/org/mybatis/mybatis/3.4.6/mybatis-3.4.6.jar) to method java.lang.Class.checkPackageAccess(java.lang.SecurityManager,java.lang.ClassLoader,boolean)
WARNING: Please consider reporting this to the maintainers of org.apache.ibatis.reflection.Reflector
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
警告:发生了非法的反射访问操作
警告:非法反射访问来自: org.apache.ibatis.reflection.Reflector(文件:/C:/Users/XXX/.m2/repository/org/mybatis/mybatis/3.4.6/mybatis-3.4.6.jar) to method java.lang.Class.checkPackageAccess(java.lang.SecurityManager,java.lang.ClassLoader,boolean)
警告:请考虑将此报告给org.apache.ibatis.reflection.Reflector
警告:User --ilgal access = 警告以启用有关进一步的非法反射访问操作的警告
警告:在将来的版本中,所有非法访问操作都将被拒绝

原因

推测是mybatis版本过低,不兼容该jdk版本
	如mybatis3.4.6兼容jdk1.8及以下版本
推荐用3.5.2版本的mybatis

解决方法

  • 在pom.xml将mybatis的版本改成3.5.2
<dependency>
	<groupId>org.mybatis</groupId>
	<artifactId>mybatis</artifactId>
	<version>3.5.2</version>
</dependency>
  • 或者将jdk版本改成1.8及以下

更多推荐

MyBatis警告: WARNING: An illegal reflective access operation has occurred

本文发布于:2023-04-06 11:32:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/48be8dcec772a0a612c56df9a66ba559.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:illegal   WARNING   MyBatis   reflective   occurred

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 49329文章数
  • 14阅读数
  • 0评论数