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
发布评论