A java script to load java classes from a http server by a custom class loader works fine in jre1.6 with rhino engine. But same script doesn't
work in nashorn engine in jre1.8. Exception thrown is
java.security.AccessControlException: access denied ("java.net.SocketPermission" "172.16.48.100:8443" "connect,resolve"
I tried using below URL to give all permission for java and script code to have all permissions.
Code is similar to below lines:
"var tmp = UcmdbServiceFactory.initSSL();" +
"var serviceProvider = UcmdbServiceFactory.getServiceProvider(\"https\",\"172.16.48.100\",8443); " +
"var clientContext = serviceProvider.createClientContext(\"UCSD\"); " ;
ScriptEngineManager m = new ScriptEngineManager();
ScriptEngine engine = m.getEngineByName("nashorn");
File file = new File(args);
URI uri = file.toURI();
URL url = uri.toURL();
If anybody has any experience with network class loaders using nashorn script engine, help here.