8157947: SA: Javascript engine can't access internal packages of jdk.hotspot.agent

Alan Bateman Alan.Bateman at oracle.com
Fri May 3 09:41:13 UTC 2019


On 02/05/2019 09:35, Yasumasa Suenaga wrote:
> > Would it be possible re-outline the problem and/or include the 
> exception that is being observed?
>
> We can see TypeError thrown by Nashorn when we attach CLHSDB.
> It means JS in jdk.hotspot.agent (sa.js) could not call 
> sun.jvm.hotspot.runtime.VM::getVM .
>
> It is caused that jdk.hotspot.agent does not export to 
> jdk.scripting.nashorn.scripts module.
> I tried to open all SA packages to everyone, it works fine [1].
>
> IMHO it would be convenience that module API provides method(s) to 
> open to everyone, or --add-opens option can open modules to everyone.
>
> Anyway, I think this issue may occur any applications that JS calls 
> Java world. Thus I hope this issue would be resolved in scripting API 
> or module system.
> If so, SA should use it :-)
This version seems to be hacking into a native method used by the Module 
API. This is not maintainable.

Sundar - do you have the IAE that Yasumasa is seeing? Is this code 
generated by Nashorn that can't be accessed or is it that the clhsdb 
launcher needs to be compiled with --add-exports or --add-opens options.



More information about the serviceability-dev mailing list