Sprint Boot出现警告

503611908 发布于 2021-04-28 543 次阅读


问题

[c-alert type="warning"]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ibatis.reflection.Reflector (file:/C:/Users/Administrator/.m2/repository/org/mybatis/mybatis/3.4.0/mybatis-3.4.0.jar)to method java.lang.Object.finalize()
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
[/c-alert]

解决办法

找到编辑配置

[img]https://vkceyugu.cdn.bspapp.com/VKCEYUGU-df9040b6-66ef-461b-92a5-f74c4e71766f/72f3b977-b3c1-409a-ad9b-f8f23e126d9d.png[/img]
添加虚拟机选项添加 --add-opens java.base/java.lang=ALL-UNNAMED 配置

[img]https://vkceyugu.cdn.bspapp.com/VKCEYUGU-df9040b6-66ef-461b-92a5-f74c4e71766f/591f2b15-ddea-4c2a-ac6a-b396100b9117.png[/img]