Proxy classes and reflection (IllegalAccessException)
Alan Bateman
Alan.Bateman at oracle.com
Fri Apr 8 13:42:16 UTC 2016
On 08/04/2016 14:02, Dawid Weiss wrote:
>> I don't have time to look it just now but
>> java.annotations.common/javax.ws.rs.ext.Providers is
>> <module-name>/<class-name> and I wouldn't have expected to see this type
>> javax.ws.rs.ext.Providers in this module.
> Yes, it's a mess, I agree. It comes from the patched module. Why is
> this such a mess -- I've no idea, I'm just the user of the library. :)
Just so I have it clear. Someone has packaged the annotations with the
JAX-RS classes and -Xpatch:java.annotations.common=<jar> is used to
patch them into java.annotations.common module, is that right? I think
explains things as the interface will not be accessible outside of that
module and why the generated Proxy class is not accessible.
> :
> I remember this discussion. For now I disabled the tests that involve
> RestEast on Java9 and everything else passes. What's interesting is
> that our application (not the individual tests, the whole thing) works
> out of the box even without all these module-related hacks -- we use a
> tiny launcher that in turn collects dependencies into a single
> URLClassLoader, then runs the application from there. I found this out
> by accident, but I can already see how people may try to abuse this
> instead of going through the struggle of finding correct JVM switches
> for modules (until they become more widespread)...
>
URLClassLoader does parent delegation so I assume the types in package
javax.annotation are being split between loaders. This is not going to
work if there package private access is required.
-Alan
More information about the jigsaw-dev
mailing list