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:/E:/my_java_jar/maven_repository/org/mybatis/mybatis/3.4.5/mybatis-3.4.5.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

在学习Mybatis框架的时候遇到这些警告,其原因是Mybatis版本与jdk版本的问题;使用jdk9及以上版本会出现以上问题:

我使用的是jdk11,注入的依赖是:

<dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.4.3</version>
        </dependency>

  

解决方法:

  (1):使用jdk8及以下版本(并不推荐)

  (2):修改mybatis依赖(修改mybatis版本)

<dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.3</version>
        </dependency>

  

问题成功解决........

猜你喜欢

转载自www.cnblogs.com/sprite1/p/12790840.html
今日推荐