본문 바로가기

오류해결/spring

An illegal reflective access operation has occurred

1. 증상

Groovy에 의존성을 지닌 모듈을 사용했더니 해당 메세지가 떴다.


2. 원인


jdk 11이 내는 경고였다. 스택오버플로우를 보니 다음과 같은 글이 있었다.


Groovy is having to undergo significant changes to accommodate the Java 9 module system; this is why the version is labeled alpha-1. If you're new to Groovy and Java, start with Groovy 2.4 (and probably Java 8) to get acquainted before dealing with modules. -chrylis Dec 22 '17 at 5:46

(https://stackoverflow.com/questions/47935772/groovy-warning-an-illegal-reflective-access-operation-has-occurred)


나는 우선 저기서 말하는 new to Groovy and Java 인 것 같아서 원인을 더 깊게 찾아보지는 않았다.


더 자세히 알아보려면 Java illegal reflective access를 찾아보면 될 것 같다.

https://stackoverflow.com/questions/50251798/what-is-an-illegal-reflective-access



3. 해결책


JDK 버전을 8로 낮추면 된다.


현재 글을 쓰는 시점에 groovy에서 이 이슈는 unresolved 상태다(https://issues.apache.org/jira/browse/GROOVY-8339)

groovy나 스택오버플로우 얘기를 보면 일단은 warning이므로 무시해도 된다고 한다(조만간 업데이트 해준다고 함).