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

Removes Illegal reflective access of DelegatingClassLoader #8355

Merged
merged 1 commit into from Apr 17, 2018
Merged

Removes Illegal reflective access of DelegatingClassLoader #8355

merged 1 commit into from Apr 17, 2018

Conversation

schmitch
Copy link
Contributor

@schmitch schmitch commented Apr 9, 2018

Helpful things

Fixes

Fixes #8350

Purpose

under JDK 9+ DelegatingClassLoader raised an Illegal reflective access
error.
By changing ApplicationClassLoaderProvider to use an URLClassLoader
the whole reflective access can be removed.

Background Context

Currently nobody uses ApplicationClassLoaderProvider with a different ClassLoader than an URLClassLoader. I even checked Lagom and they basically have the same classes than Play which also implement and URLClassLoader. Gradle does not use anything from play.runsupport.

After that PR on sbt 1.1.2 and master Branch we would still see (and of course we still need to add jaxb):

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

But that can't be fixed on our side

under JDK 9+ DelegatingClassLoader raised an Illegal reflective access
error.
By changing ApplicationClassLoaderProvider to use an URLClassLoader
the whole reflective access can be removed.
Copy link
Member

@richdougherty richdougherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea even if we didn't get any Java 9 errors. Thanks!

@richdougherty richdougherty merged commit e6ed774 into playframework:master Apr 17, 2018
@igor-savin-ht
Copy link

@Schmith Is there an issue raised on guice side already, or should I create one?

@schmitch
Copy link
Contributor Author

There is: google/guice#1133
But I'm not sure if it has so much attention.

@schmitch schmitch deleted the issue-8350 branch April 18, 2018 07:10
@unistylist
Copy link

What version of Play Framework will be patched from this merge?

@richdougherty
Copy link
Member

@unistylist, aiming for 2.6.14 - see #8420.

richdougherty pushed a commit that referenced this pull request May 21, 2018
…8420)

Under JDK 9+ DelegatingClassLoader raised an Illegal reflective access
error. By changing ApplicationClassLoaderProvider to use an
URLClassLoader the whole reflective access can be removed.
@richdougherty richdougherty removed this from the Play 2.6.14 milestone May 24, 2018
ignasi35 added a commit to ignasi35/playframework that referenced this pull request Dec 11, 2019
ignasi35 added a commit to ignasi35/playframework that referenced this pull request Dec 19, 2019
gslowikowski added a commit to play2-maven-plugin/play2-maven-plugin that referenced this pull request Jan 5, 2020
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

Successfully merging this pull request may close these issues.

Illegal reflective access by play.runsupport.classloader.DelegatingClassLoader (Java 9)
4 participants