Proposals for some open JPMS issues, #ReflectiveAccessByInstrumentationAgents

Andrew Dinn adinn at redhat.com
Tue Jul 5 09:18:04 UTC 2016


Hi Remi,

On 05/07/16 00:00, Remi Forax wrote:
> Hi Andrew, for me it's another issue,
> currently you can not use a modular jar with the -javaagent on the command line,
> it's seems to be the root cause of your issue.

Yes, that's basically it. Although, I'll admit I'm not really keen on
making my agent modular. However, if the agent jar was modular then the
current proposal would be workable.

> Now, the workaround,
> there are two ways to create a module, one is to have a modular jar in the modulepath,
> the other is to create a Layer to dynamically creates a module at runtime.
> So currently, you can have the main instrumentation class in a default module,
> this class can dynamically creates your module M', and add an export fom M' to M
> each time you need to rewrite a class of a module M.

I mentioned in my previous post that the first option is at best awkward
(in the command line use case) and, worse, is not going to be of help
when the agent is loaded dynamically (which is the normal usage for my
agent).

Can you explain in more detail [or, better, point me at the docs which
show] how I can create a module at runtime? I did not think that was
possible. I think that would be by far the best option for me and it
would also make the current proposal acceptable.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the jigsaw-dev mailing list