에러메시지:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
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
원인: JDK 버전문제
참고내용)
JDK11.An illegal reflective access operation has occurred
JDK11 환경에서 개발중 위 메시지와 같은 에러가 발생했다.
아래와 같이 HATEOAS의 methodOn에서 자신의 Class를 직접 호출하는 부분에서 에러가 발생하였으며, 컴파일에는 문제가 없었다.
// code
linkTo(methodOn(Some.class))// console
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils (file:******.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.2.7.RELEASE/56e14a3a5e2813534b5db2da1502cd58ab5bc61d/spring-core-5.2.7.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils
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
원인은 JDK 9 이상의 환경에서 CGLIB의 JDK API 내부에서 발생한 것으로,
Spring Framework 4.3 기준 실행중 문제는 없다고 한다.
해결하려면JDK 8버전으로 JDK를 내리거나, Spring Framework 5.1 이상
혹은 SpringBoot 2.1 이상의 버전을 올리면 된다고 하지만 안된다!!
Spring projects의 issue에 올라왔던 내용이며, Spring5.1 이상에서는 해결이 됐다고 하지만, 해당 버전을 사용하지 않기 때문에 해결됐는지는 모르겠다.
출처:
JDK11.An illegal reflective access operation has occurred | by Byungkyu Ju | byungkyu-ju | Medium
'Server, OS > 리눅스' 카테고리의 다른 글
리눅스 find 사용법 (파일찾기) (0) | 2022.05.23 |
---|---|
/etc/profile, /etc/bashrc, ~/.bashrc ~/.bash_profile 차이 (0) | 2022.05.23 |
톰캣 구동 확인 (0) | 2022.05.17 |
centos7 리눅스 alias 영구등록 (0) | 2022.05.17 |
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000eaaa0000, 178978816, 0) failed; error='Not enough space' (errno=12) (0) | 2022.05.16 |