You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a script with jjs that invokes a class from a classpath configured with 'jjs -cp', that will make use of URLClassLoader.findClass, the behavior is different from when the Java library is invoked the usual way.
When launched with jjs -cp, Nashorn creates a ClassLoader using the specified class path but, unlike java -cp, it does not make that ClassLoader the thread context class loader. This means we end up trying to load classes using the app class loader which can't see any of the classes that are on the class path.
Setting the thread context class loader before calling run() fixes the problem:
When running a script with jjs that invokes a class from a classpath configured with 'jjs -cp', that will make use of URLClassLoader.findClass, the behavior is different from when the Java library is invoked the usual way.
See log trace: https://gist.github.com/brunoborges/110af2969f2c2be7e288
To invoke code, see: https://github.com/brunoborges/nashorn/tree/master/maven/samples/springboot
The text was updated successfully, but these errors were encountered: