Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8059619

nbexec on modular image leads to recursive initialization of MimeTable and NPE

    Details

    • Subcomponent:
    • Verification:
      Not verified

      Description

      Starting NetBean 8.0.1 on OS X with a build of jigsaw/m2 results in this error at startup.

      Note that the error is misleading, the issue seems to be that NetBeans has set a URLStreamHandlerFactory early in the startup and before sun.net.www.MimeTable has been initialized. The result stack (see below) seems to be a recursive initialization of MimeTable that leads to a NPE that is translated into a MalformedURLException and InternalError.

      java.lang.InternalError: java.net.MalformedURLException
      at sun.misc.URLClassPath$JImageLoader.toURL(URLClassPath.java:1137)
      at sun.misc.URLClassPath$JImageLoader.getResource(URLClassPath.java:1169)
      at sun.misc.URLClassPath.getResource(URLClassPath.java:204)
      at sun.misc.URLClassPath.getResource(URLClassPath.java:256)
      at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1259)
      at java.lang.ClassLoader.getResource(ClassLoader.java:1088)
      at java.lang.ClassLoader.getResource(ClassLoader.java:1086)
      at java.lang.ClassLoader.getSystemResource(ClassLoader.java:1221)
      at java.lang.ClassLoader.getSystemResourceAsStream(ClassLoader.java:1324)
      at java.lang.Class.getResourceAsStream(Class.java:2224)
      at sun.net.www.MimeTable.load(MimeTable.java:249)
      at sun.net.www.MimeTable.<init>(MimeTable.java:74)
      at sun.net.www.MimeTable$DefaultInstanceHolder$1.run(MimeTable.java:84)
      at sun.net.www.MimeTable$DefaultInstanceHolder$1.run(MimeTable.java:82)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.net.www.MimeTable$DefaultInstanceHolder.getDefaultInstance(MimeTable.java:81)
      at sun.net.www.MimeTable$DefaultInstanceHolder.<clinit>(MimeTable.java:78)
      at sun.net.www.MimeTable.getDefaultTable(MimeTable.java:97)
      at sun.net.www.MimeTable.loadTable(MimeTable.java:109)
      at java.net.URLConnection.getFileNameMap(URLConnection.java:307)
      at java.net.URLConnection.guessContentTypeFromName(URLConnection.java:1374)
      at sun.net.www.protocol.jar.JarURLConnection.getContentType(JarURLConnection.java:218)
      at java.net.URLConnection.getContentHandler(URLConnection.java:1227)
      at java.net.URLConnection.getContent(URLConnection.java:757)
      at java.net.URL.getContent(URL.java:1068)
      at org.openide.util.lookup.MetaInfServicesLookup.search(MetaInfServicesLookup.java:311)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookup(MetaInfServicesLookup.java:156)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookupResult(MetaInfServicesLookup.java:135)
      at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:483)
      at org.openide.util.lookup.ProxyLookup$R.initResults(ProxyLookup.java:390)
      at org.openide.util.lookup.ProxyLookup$R.addLookupListener(ProxyLookup.java:489)
      at org.netbeans.ProxyURLStreamHandlerFactory.createURLStreamHandler(ProxyURLStreamHandlerFactory.java:153)
      at java.net.URL.getURLStreamHandler(URL.java:1135)
      at java.net.URL.<init>(URL.java:589)
      at java.net.URL.<init>(URL.java:480)
      at java.net.URL.<init>(URL.java:429)
      at sun.misc.URLClassPath$JImageLoader.toURL(URLClassPath.java:1135)
      at sun.misc.URLClassPath$JImageLoader.findResource(URLClassPath.java:1147)
      at sun.misc.URLClassPath$1.next(URLClassPath.java:231)
      at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:241)
      at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
      at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
      at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
      at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
      at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
      at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
      at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
      at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
      at sun.util.locale.provider.JRELocaleProviderAdapter$1.run(JRELocaleProviderAdapter.java:382)
      at sun.util.locale.provider.JRELocaleProviderAdapter$1.run(JRELocaleProviderAdapter.java:377)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.util.locale.provider.JRELocaleProviderAdapter.createSupportedLocaleString(JRELocaleProviderAdapter.java:377)
      at sun.util.locale.provider.JRELocaleProviderAdapter.createLanguageTagSet(JRELocaleProviderAdapter.java:358)
      at sun.util.locale.provider.JRELocaleProviderAdapter.getLanguageTagSet(JRELocaleProviderAdapter.java:348)
      at sun.util.locale.provider.JRELocaleProviderAdapter.getDateFormatProvider(JRELocaleProviderAdapter.java:165)
      at sun.util.locale.provider.JRELocaleProviderAdapter.getLocaleServiceProvider(JRELocaleProviderAdapter.java:91)
      at sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:284)
      at sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:254)
      at java.text.DateFormat.get(DateFormat.java:797)
      at java.text.DateFormat.getDateTimeInstance(DateFormat.java:586)
      at org.netbeans.core.startup.TopLogging.printSystemInfo(TopLogging.java:234)
      at org.netbeans.core.startup.TopLogging.initialize(TopLogging.java:211)
      at org.netbeans.core.startup.TopLogging.initialize(TopLogging.java:173)
      at org.netbeans.core.startup.CLIOptions.initialize(CLIOptions.java:252)
      at org.netbeans.core.startup.Main.start(Main.java:241)
      at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.net.MalformedURLException
      at java.net.URL.<init>(URL.java:617)
      at java.net.URL.<init>(URL.java:480)
      at java.net.URL.<init>(URL.java:429)
      at sun.misc.URLClassPath$JImageLoader.toURL(URLClassPath.java:1135)
      ... 68 more
      Caused by: java.lang.NullPointerException
      at java.net.URLConnection$1.getContentTypeFor(URLConnection.java:314)
      at java.net.URLConnection.guessContentTypeFromName(URLConnection.java:1374)
      at sun.net.www.protocol.jar.JarURLConnection.getContentType(JarURLConnection.java:218)
      at java.net.URLConnection.getContentHandler(URLConnection.java:1227)
      at java.net.URLConnection.getContent(URLConnection.java:757)
      at java.net.URL.getContent(URL.java:1068)
      at org.openide.util.lookup.MetaInfServicesLookup.search(MetaInfServicesLookup.java:311)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookup(MetaInfServicesLookup.java:156)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookupResult(MetaInfServicesLookup.java:135)
      at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:483)
      at org.openide.util.lookup.ProxyLookup$R.initResults(ProxyLookup.java:390)
      at org.openide.util.lookup.ProxyLookup$R.addLookupListener(ProxyLookup.java:489)
      at org.netbeans.ProxyURLStreamHandlerFactory.createURLStreamHandler(ProxyURLStreamHandlerFactory.java:153)
      at java.net.URL.getURLStreamHandler(URL.java:1135)
      at java.net.URL.<init>(URL.java:589)
      ... 71 more


      Here is the full stack trace when MimeTable attempts to load content-types.properties


      java.lang.Exception: Stack trace
      at java.lang.Thread.dumpStack(Thread.java:1329)
      at sun.net.www.MimeTable.loadTable(MimeTable.java:105)
      at java.net.URLConnection.getFileNameMap(URLConnection.java:307)
      at java.net.URLConnection.guessContentTypeFromName(URLConnection.java:1374)
      at sun.net.www.protocol.jar.JarURLConnection.getContentType(JarURLConnection.java:218)
      at java.net.URLConnection.getContentHandler(URLConnection.java:1227)
      at java.net.URLConnection.getContent(URLConnection.java:757)
      at java.net.URL.getContent(URL.java:1068)
      at org.openide.util.lookup.MetaInfServicesLookup.search(MetaInfServicesLookup.java:311)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookup(MetaInfServicesLookup.java:156)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookupResult(MetaInfServicesLookup.java:135)
      at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:483)
      at org.openide.util.lookup.ProxyLookup$R.initResults(ProxyLookup.java:390)
      at org.openide.util.lookup.ProxyLookup$R.addLookupListener(ProxyLookup.java:489)
      at org.netbeans.ProxyURLStreamHandlerFactory.createURLStreamHandler(ProxyURLStreamHandlerFactory.java:153)
      at java.net.URL.getURLStreamHandler(URL.java:1135)
      at java.net.URL.<init>(URL.java:589)
      at java.net.URL.<init>(URL.java:480)
      at java.net.URL.<init>(URL.java:429)
      at sun.misc.URLClassPath$JImageLoader.toURL(URLClassPath.java:1135)
      at sun.misc.URLClassPath$JImageLoader.getResource(URLClassPath.java:1169)
      at sun.misc.URLClassPath.getResource(URLClassPath.java:204)
      at sun.misc.URLClassPath.getResource(URLClassPath.java:256)
      at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1259)
      at java.lang.ClassLoader.getResource(ClassLoader.java:1088)
      at java.lang.ClassLoader.getResource(ClassLoader.java:1086)
      at java.lang.ClassLoader.getSystemResource(ClassLoader.java:1221)
      at java.lang.ClassLoader.getSystemResourceAsStream(ClassLoader.java:1324)
      at java.lang.Class.getResourceAsStream(Class.java:2224)
      at sun.net.www.MimeTable.load(MimeTable.java:249)
      at sun.net.www.MimeTable.&lt;init&gt;(MimeTable.java:74)
      at sun.net.www.MimeTable$DefaultInstanceHolder$1.run(MimeTable.java:84)
      at sun.net.www.MimeTable$DefaultInstanceHolder$1.run(MimeTable.java:82)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.net.www.MimeTable$DefaultInstanceHolder.getDefaultInstance(MimeTable.java:81)
      at sun.net.www.MimeTable$DefaultInstanceHolder.&lt;clinit&gt;(MimeTable.java:78)
      at sun.net.www.MimeTable.getDefaultTable(MimeTable.java:97)
      at sun.net.www.MimeTable.loadTable(MimeTable.java:109)
      at java.net.URLConnection.getFileNameMap(URLConnection.java:307)
      at java.net.URLConnection.guessContentTypeFromName(URLConnection.java:1374)
      at sun.net.www.protocol.jar.JarURLConnection.getContentType(JarURLConnection.java:218)
      at java.net.URLConnection.getContentHandler(URLConnection.java:1227)
      at java.net.URLConnection.getContent(URLConnection.java:757)
      at java.net.URL.getContent(URL.java:1068)
      at org.openide.util.lookup.MetaInfServicesLookup.search(MetaInfServicesLookup.java:311)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookup(MetaInfServicesLookup.java:156)
      at org.openide.util.lookup.MetaInfServicesLookup.beforeLookupResult(MetaInfServicesLookup.java:135)
      at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:483)
      at org.openide.util.lookup.ProxyLookup$R.initResults(ProxyLookup.java:390)
      at org.openide.util.lookup.ProxyLookup$R.addLookupListener(ProxyLookup.java:489)
      at org.netbeans.ProxyURLStreamHandlerFactory.createURLStreamHandler(ProxyURLStreamHandlerFactory.java:153)
      at java.net.URL.getURLStreamHandler(URL.java:1135)
      at java.net.URL.<init>(URL.java:589)
      at java.net.URL.<init>(URL.java:480)
      at java.net.URL.<init>(URL.java:429)
      at sun.misc.URLClassPath$JImageLoader.toURL(URLClassPath.java:1135)
      at sun.misc.URLClassPath$JImageLoader.findResource(URLClassPath.java:1147)
      at sun.misc.URLClassPath$1.next(URLClassPath.java:231)
      at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:241)
      at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
      at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
      at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
      at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
      at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
      at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
      at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
      at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
      at sun.util.locale.provider.JRELocaleProviderAdapter$1.run(JRELocaleProviderAdapter.java:382)
      at sun.util.locale.provider.JRELocaleProviderAdapter$1.run(JRELocaleProviderAdapter.java:377)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.util.locale.provider.JRELocaleProviderAdapter.createSupportedLocaleString(JRELocaleProviderAdapter.java:377)
      at sun.util.locale.provider.JRELocaleProviderAdapter.createLanguageTagSet(JRELocaleProviderAdapter.java:358)
      at sun.util.locale.provider.JRELocaleProviderAdapter.getLanguageTagSet(JRELocaleProviderAdapter.java:348)
      at sun.util.locale.provider.JRELocaleProviderAdapter.getDateFormatProvider(JRELocaleProviderAdapter.java:165)
      at sun.util.locale.provider.JRELocaleProviderAdapter.getLocaleServiceProvider(JRELocaleProviderAdapter.java:91)
      at sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:284)
      at sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:254)
      at java.text.DateFormat.get(DateFormat.java:797)
      at java.text.DateFormat.getDateTimeInstance(DateFormat.java:586)
      at org.netbeans.core.startup.TopLogging.printSystemInfo(TopLogging.java:234)
      at org.netbeans.core.startup.TopLogging.initialize(TopLogging.java:211)
      at org.netbeans.core.startup.TopLogging.initialize(TopLogging.java:173)
      at org.netbeans.core.startup.CLIOptions.initialize(CLIOptions.java:252)
      at org.netbeans.core.startup.Main.start(Main.java:241)
      at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
      at java.lang.Thread.run(Thread.java:745)


        Attachments

          Activity

            People

            • Assignee:
              alanb Alan Bateman
              Reporter:
              alanb Alan Bateman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: