Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal reflective access operation has occurred #1944

Open
MarcusTXK opened this issue Mar 13, 2023 · 6 comments
Open

Illegal reflective access operation has occurred #1944

MarcusTXK opened this issue Mar 13, 2023 · 6 comments

Comments

@MarcusTXK
Copy link
Member

Please include the steps to reproduce the bug.

  1. Run any tests from ConfigSystemTest
  2. A warning will appears: WARNING: Illegal reflective access by com.google.gson.internal.reflect.ReflectionHelper.

What was expected to happen?

Illegal reflective access should not occur.

What actually happened? Please include a screenshot of the output.

image

@MarcusTXK MarcusTXK self-assigned this Mar 13, 2023
@MarcusTXK
Copy link
Member Author

MarcusTXK commented Mar 13, 2023

Preliminary investigation shows that the problem can likely be solved if we locate the offending class (likely a java.* class) and avoiding serializing java.* classes without writing an explicit type-adapter. More on potential solutions on this issue here.

I am still trying to detect the exact source (other than that it comes from java.util.Collections), but have not found it yet. If anyone has any idea of the source, please do add it to the issue. My current suspicion is with SystemTestUtil.

@yhtMinceraft1010X
Copy link
Contributor

yhtMinceraft1010X commented Mar 14, 2023

Just to check, are you using Java 8?

Sometimes I encounter this, only to realise that I'm on Java 11. That being said though, we claim to support Java 11 in our DG.

@MarcusTXK
Copy link
Member Author

MarcusTXK commented Mar 14, 2023

Im currently using Java 11, but with a language level of 8 (in Intellij IDEA). That said, Im not exactly sure how much the language level affects the compiler, or if it just impacts the intellisense provided by the IDE. It might be just a Java 9 and above bug.

@sikai00
Copy link
Member

sikai00 commented Mar 18, 2023

I am using Azul Java 11.0.16 on M2 Macbook Air, and I actually encounter this error in almost all if not all my runs of RepoSense. It does not seem to affect the runs however in my case.

@MarcusTXK
Copy link
Member Author

MarcusTXK commented Mar 19, 2023

To clarify, this does not affect my runs either, but it might be good to resolve as All illegal access operations will be denied in a future release. This affects future java releases, such as in Java 17 onwards where reflective access is no longer permitted. This can be read more about here in oracle's blog post detailing Java 17's changes and going into detail about this error message.

@MarcusTXK MarcusTXK removed their assignment Apr 6, 2023
@ckcherry23
Copy link
Member

Referenced in discussion #1997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

5 participants