Running Nashorn under java.lang.instrument
David P. Caldwell
david at code.davidpcaldwell.com
Mon Oct 13 21:37:40 UTC 2014
So if I run Nashorn under a Java agent, I can't start it. I haven't
yet dug into the error, but when I invoke:
return new ScriptEngineManager().getEngineByName("nashorn") != null
, which is my "is Nashorn installed" check, the following prints to System.err:
ScriptEngineManager providers.next():
javax.script.ScriptEngineFactory: Provider
jdk.nashorn.api.scripting.NashornScriptEngineFactory could not be
instantiated
Does anyone immediately know what would be wrong?
My Transformer in the class does this:
if (protectionDomain == null) return null;
... so it shouldn't be attempting to transform any Nashorn classes.
On the other hand, if it's relevant, the ClassLoader that loaded the
class above that executes return new ScriptEngineManager() ... is not
loaded by the system class loader; it's loaded by an URLClassLoader
that sits on top of that (it does delegate to the system class
loader). Under normal circumstances, this wouldn't make a difference,
but just in case ...
Anyone immediately have an idea what I might be dealing with here?
-- David P. Caldwell
http://www.davidpcaldwell.com/
More information about the nashorn-dev
mailing list