This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Build: NetBeans Dev JDK9 branch (Build 20151021-795746744b4b) VM: Java HotSpot(TM) 64-Bit Server VM, 1.9.0-ea-jigsaw-nightly-h3477-20150929-b83, Java(TM) SE Runtime Environment, 1.9.0-ea-jigsaw-nightly-h3477-20150929-b83 OS: Mac OS X User Comments: thurka: jigsaw, open heapdump, go to OQL console, select sample OQL query - list java.io.File Stacktrace: java.lang.SecurityException: sealing violation at org.netbeans.JarClassLoader.doLoadClass(JarClassLoader.java:265) at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:259) at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:373) at org.netbeans.modules.javascript2.editor.JsLanguage.getParser(JsLanguage.java:111) at org.netbeans.modules.csl.core.Language.getParser(Language.java:289)
Created attachment 156867 [details] stacktrace
Evaluation by jlahoda: Let us have module, which masks some packages from bootclasspath - in our case libs.nashorn. So in general classes from nashorn can be loaded twice - from bootclasspath and from libs.nashorn module. The first are used in OQL console, second case is from javascript editor infrastructure. The SecurityException is thrown when nashorn classes are loaded first from bootclasspath. Next when classes are loaded from libs.nashorn module, ProxyClassLoader.loadClass() will correctly try to load class from libs.nashorn jar file instead of delegating to the parent class loader. However getPackageFast(<package>, true) is invoked during ProxyClassLoader.loadClass() invocation and it (incorrectly) finds package from bootclasspath. This was not a problem, but jigsaw build now has sealed packages and JarClassLoader.doLoadClass() correctly throws 'SecurityException: sealing violation", since one cannot add classes to sealed package from different source. It looks like ProxyClassLoader.getPackage(Fast) should check shouldDelegateResource and do not return masked packages from parent classloader.
Fixed in profiler-main changeset: 292858:6936edbde396 user: Tomas Hurka <thurka@netbeans.org> date: Thu Nov 05 14:50:21 2015 +0100 summary: bugfix #256071, consult shouldDelegateResource() when delegating to parent classloader (fix contributed by jlahoda)
Integrated into 'main-silver', will be available in build *201511060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6936edbde396 User: Tomas Hurka <thurka@netbeans.org> Log: bugfix #256071, consult shouldDelegateResource() when delegating to parent classloader (fix contributed by jlahoda)