解决mybatis输出警告:Illegal reflective access by org.apache.ibatis.reflection.Reflector xxx to method java.lang.Integer.getChars(int,int,byte[])
项目中引用了mybatis,在查询sql时,mybatis输出警告如下:
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.Integer.getChars(int,int,byte[]) 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 springboot starter版本为:1.3.2
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.2</version> </dependency>
版本较老,升级为新的版本 2.1.3,不再报警告。