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
Improve diagnostics for CGLIB ClassLoader issues with shared classes in parent ClassLoader #25940
Comments
I'm afraid this is expected since the official JDK 9 From that perspective, your current deployment layout is generally not supported with That said, we could at least provide some hints for such scenarios in our documentation... since this isn't obvious at all. |
@jhoeller thanks for such a quick reply. Using Let me ask a question, just out of my curiosity. What if proxy classes had unique names per application context? Wouldn't that solve the issue? |
It looks like we can address this along the lines of #28747, throwing a corresponding exception from As for proxy classes with unique names, that would only solve part of the problem since there would still be leaks from the higher ClassLoader to the shared ClassLoader in the runtime-generated classes. It's definitely preferable to isolate this into each specific application ClassLoader. |
Reproducible on JDK 11, 15 (presumably 9+) and the latest Spring Framework (5.2.9).
I put together a simple reproducer, which mimics the Tomcat setup where this issue can be observed.
The deployment configuration is as follows.
--illegal-access=deny
and BOTH apps are deployed, the second app fails with the error.--illegal-access=deny
and just ONE app is deployed, everything works fine.--illegal-access=warn
(or simply without this argument) and either one app or both apps are deployed, everything works fine.--illegal-access
, but the libraries are placed on the module path, the second app fails with the error.The reproducer is here. Run
gradlew runWithIllegalAccessDeny
,gradlew runWithIllegalAccessWarn
, andgradlew runOnModulePath
accordingly.The error:
The text was updated successfully, but these errors were encountered: