Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5638

NbTestCase.assertGC fails with SecurityException

Details

    Description

      During testing, I've found out that assertGC paths to root analysis fails with SecurityException and does not provide any reasonable results:

      java.lang.SecurityException: Prohibited package name: java.lang
      	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:655)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:754)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
      	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
      	at java.lang.Class.getDeclaredMethods0(Native Method)
      	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      	at java.lang.Class.getDeclaredMethods(Class.java:1975)
      	at org.netbeans.insane.impl.InsaneEngine.recognizeClass(InsaneEngine.java:123)
      

      The exception was thrown, because Insane library queries getDeclaredMethods() on org.netbeans.NbInstrumentation - the whole heap traversal then fails, since on JDK8 Module is not loaded from runtime, and an attempt to load it from boot.jar fails.

       

      Attachments

        Issue Links

          Activity

            // cc: jtulach

            sdedic Svatopluk Dedic added a comment - // cc: jtulach

            Ignoring SecurityException in Insane seems to be the cheapest fix.

            jtulach Jaroslav Tulach added a comment - Ignoring SecurityException in Insane seems to be the cheapest fix.

            People

              sdedic Svatopluk Dedic
              sdedic Svatopluk Dedic
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m