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 in ContextOverridingClassLoader.isEligibleForOverriding #31232

Closed
geiliev opened this issue Sep 14, 2023 · 3 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@geiliev
Copy link

geiliev commented Sep 14, 2023

Affects: 6.0.11


Related to #22791
The fix in the related issue doesn't resolve the problem and the application still fails to start.
The problem is that event though the findLoadedClass method is inaccessible it is still called in isEligibleForOverriding which results in an IllegalAccessException and failure to start the application.

@bclozel
Copy link
Member

bclozel commented Sep 14, 2023

Can you share a minimal sample application that reproduces the problem? Thanks!

@bclozel bclozel added the status: waiting-for-feedback We need additional information before we can continue label Sep 14, 2023
@jhoeller
Copy link
Contributor

Oops, looks like there is a method = null; missing there in the catch block in case of makeAccessible failing. This just missed the 6.0.12 release by a day, so we'll fix it for 6.0.13 where this will be available in snapshot builds soon.

For the time being, and actually as a general recommendation since it increases the performance of temporary class loading, please set --add-opens=java.base/java.lang=ALL-UNNAMED on the command line.

@jhoeller jhoeller added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 14, 2023
@jhoeller jhoeller self-assigned this Sep 14, 2023
@jhoeller jhoeller added this to the 6.0.13 milestone Sep 14, 2023
@jhoeller jhoeller added the for: backport-to-5.3.x Marks an issue as a candidate for backport to 5.3.x label Sep 14, 2023
@github-actions github-actions bot added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.3.x Marks an issue as a candidate for backport to 5.3.x labels Sep 14, 2023
@sbrannen sbrannen changed the title Illegal reflective access in ContextOverridingClassLoader.isEligibleForOverriding Illegal reflective access in ContextOverridingClassLoader.isEligibleForOverriding Sep 14, 2023
@geiliev
Copy link
Author

geiliev commented Sep 15, 2023

Oops, looks like there is a method = null; missing there in the catch block in case of makeAccessible failing. This just missed the 6.0.12 release by a day, so we'll fix it for 6.0.13 where this will be available in snapshot builds soon.

For the time being, and actually as a general recommendation since it increases the performance of temporary class loading, please set --add-opens=java.base/java.lang=ALL-UNNAMED on the command line.

Thank you, I have added --add-opens=java.base/java.lang=ALL-UNNAMED anyway and it is working.
Just thought it will be nice to work without it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants