[JDK11] An illegal reflective access operation has occurred
2021. 12. 19. 17:01ㆍSpring Boot/Exception handling
JDK 11로 설정된 Spring Boot 프로젝트를 실행시키면 아래와 같은 오류 메시지가 나온다.
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.esotericsoftware.reflectasm.AccessClassLoader (file:...) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.esotericsoftware.reflectasm.AccessClassLoader 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
뭔가 빨간색이라 빨리 고쳐야 할 것 같은 예감이 든다.
하지만, 실제로는 Spring Boot가 실행되는데는 전혀 지장이 없다.
원인은 JDK 9 이상의 환경에서 CGLIB의 JDK API 내부에서 발생한 것으로 실행중 문제는 없다고 한다.
해결하기 위해서는 JDK 버전을 8로 내리거나, Spring Boot의 버전을 올리면 된다고 한다.
(Spring Framework 5.1 ↑, Spring Boot 2.1↑)
→ 라고 나와는 있엇지만, 나는 Spring Boot 2.6을 이용하고 있는데 왜 오류가 나오지?..
JDK 16, 17에서는 해결 될 것으로 보이지만 실제로 실무에 JDK 16, 17버전을 당장 적용시키기에는 무리가 있어 11버전으로 사용할 때 저 메시지가 보기 싫다면 VM Options에 아래와 같이 넣어주면 된다.
--illegal-access=warn
'Spring Boot > Exception handling' 카테고리의 다른 글
[JPA] deleteBy 오류 및 ResultSet 오류 (0) | 2021.11.18 |
---|