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

An illegal reflective access operation has occurred #10886

Closed
bursauxa opened this issue Jun 2, 2021 · 7 comments
Closed

An illegal reflective access operation has occurred #10886

bursauxa opened this issue Jun 2, 2021 · 7 comments

Comments

@bursauxa
Copy link
Contributor

bursauxa commented Jun 2, 2021

Play Version

2.8.8

API

Scala

JDK

Java 11

Expected Behavior

Running a basic Play project should not issue any warning

Actual Behavior

The following warning is produced at start:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:<omitted>/com/google/inject/guice/4.2.3/guice-4.2.3.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 com.google.inject.internal.cglib.core.$ReflectUtils$1
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

Additional information

This warning starts with Java 9, it was not present in Java 8. The root cause is an issue in Guice (google/guice#1133) that is fixed in Guice 5.0.1.

However, despite the dependencies file (https://github.com/playframework/playframework/blob/master/project/Dependencies.scala) listing guice 5.0.1 since February 27th, play-guice 2.8.8 released on April 8th still pulls guice 4.2.3, as evidenced by the dependency graph below:

com.typesafe.play:play-guice_2.13:2.8.8
    com.google.inject.extensions:guice-assistedinject:4.2.3
        com.google.inject:guice:4.2.3
    com.google.inject:guice:4.2.3
    com.typesafe.play:play_2.13:2.8.8
@mkurz
Copy link
Member

mkurz commented Jun 2, 2021

This got fixed in the master branch already. You have to wait for Play 2.9.

@mkurz mkurz closed this as completed Jun 2, 2021
@bursauxa
Copy link
Contributor Author

bursauxa commented Jun 2, 2021

Thanks @mkurz, I will be waiting then 🎉

@fancellu
Copy link

Still waiting, nearly 2 years later...

@claytonjacobs
Copy link

Still waiting. Blocker for updating to Java 11.

@claytonjacobs
Copy link

Still waiting. Blocker for updating to Java 11.

Adding this to libraryDependencies (and leaving in guice) in build.sbt got rid of the errors.

"com.google.inject" % "guice" % "5.1.0"

@mkurz
Copy link
Member

mkurz commented Sep 20, 2023

Still waiting, nearly 2 years later...

Still waiting. Blocker for updating to Java 11.

Play 2.9 release candidate available now finally fixing this problem: https://github.com/playframework/playframework/releases/tag/2.9.0-RC2

@bursauxa
Copy link
Contributor Author

Thanks @mkurz, I will be waiting then 🎉

The wait is finally over 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants