Accessing module internals from bytecode rewriting agent
Alan.Bateman at oracle.com
Tue Apr 25 06:22:30 UTC 2017
On 25/04/2017 04:26, Martin Buchholz wrote:
> java.lang.IllegalArgumentException: illegal lookupClass: class
> Bytecode rewriting agents have the power to inject code into classes; they
> should somehow also be able to reflectively inspect those same classes!
> But how? We ran into similar problems trying to port java agents at Google
> to jdk9.
On the general point: agents (both java and JVM TI agents) can redefine
any module in support of instrumentation and any amount of deep
reflection that the agent might do. So I wouldn't expect too many issues
although some java agents may need updates to work on JDK 9 without
encapsulation busting command line options.
On Byteman, Andrew Dinn has been working with us on jigsaw-dev on the
agent support. From the stack trace then I suspect the issue you are
running into is that Byteman has also changed to use the new reflection
API (java.lang.invoke) and is running into a long standing check to
prevent full power lookups to full privileged classes from leaking.
Andrew brought this up on jigsaw-dev  a few days ago and we could
probably move that thread to core-libs-dev.
More information about the jigsaw-dev