netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Error in startup caused by proxy

Open michelecos opened this issue 2 years ago • 1 comments

Apache NetBeans version

Apache NetBeans 13

What happened

Netbeans fails during startup in a corporate network with a proxy server with deep packet inspection. This is the stack trace

D:\netbeans\bin>netbeans64.exe --jdkhome "%JAVA_HOME%"

D:\netbeans\bin>

The launcher has determined that the parent process has a console and will reuse it for its own console output. Closing the console will result in termination of the running program. Use '--console suppress' to suppress console output. Use '--console new' to create a separate console window. WARNING: package sun.awt.X11 not in java.desktop WARNING: package com.sun.java.swing.plaf.gtk not in java.desktop

java.lang.NullPointerException
        at java.base/java.net.URLConnection$1.getContentTypeFor(URLConnection.java:313)
        at java.base/java.net.URLConnection.guessContentTypeFromName(URLConnection.java:1464)
        at java.base/sun.net.www.protocol.jar.JarURLConnection.getContentType(JarURLConnection.java:223)
        at java.base/java.net.URLConnection.getContentHandler(URLConnection.java:1277)
        at java.base/java.net.URLConnection.getContent(URLConnection.java:778)
        at java.base/java.net.URL.getContent(URL.java:1150)
        at org.openide.util.lookup.MetaInfServicesLookup.search(MetaInfServicesLookup.java:292)
        at org.openide.util.lookup.MetaInfServicesLookup.beforeLookup(MetaInfServicesLookup.java:131)
        at org.openide.util.lookup.MetaInfServicesLookup.beforeLookupResult(MetaInfServicesLookup.java:110)
        at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:458)
        at org.openide.util.lookup.ProxyLookup$R.initResults(ProxyLookup.java:449)
        at org.openide.util.lookup.ProxyLookup$R.myBeforeLookup(ProxyLookup.java:736)
        at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:612)
        at org.openide.util.lookup.ProxyLookup$R.allItems(ProxyLookup.java:596)
        at org.openide.util.lookup.ProxyLookup$R.collImpl(ProxyLookup.java:699)
        at org.openide.util.lookup.ProxyLookup$R.collectFires(ProxyLookup.java:645)
        at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:228)
        at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
        at org.netbeans.core.startup.MainLookup.changeLookups(MainLookup.java:193)
        at org.netbeans.core.startup.MainLookup.doInitializeLookup(MainLookup.java:183)
        at org.netbeans.core.startup.MainLookup.modulesClassPathInitialized(MainLookup.java:134)
        at org.netbeans.core.startup.MainLookup.modulesClassPathInitialized(MainLookup.java:127)
        at org.netbeans.core.startup.NbInstaller.loadImpl(NbInstaller.java:360)
        at org.netbeans.core.startup.NbInstaller.access$000(NbInstaller.java:77)
        at org.netbeans.core.startup.NbInstaller$1.run(NbInstaller.java:322)
        at org.openide.filesystems.FileUtil$2.run(FileUtil.java:418)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:102)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:494)
        at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:402)
        at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:422)
        at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:319)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1457)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1254)
        at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
        at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
        at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:298)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
        at org.netbeans.core.startup.Main.start(Main.java:282)
        at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
        at java.base/java.lang.Thread.run(Thread.java:834)

How to reproduce

This happens regularly, but usually NetBeans can start after a few trials

Did this work correctly in an earlier version?

Apache NetBeans 12.5

Operating System

Windows Server 2016

JDK

openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

This happens most of the times on first launch. Sometimes less frequent when the connection with the proxy server is initiated from a browser

Are you willing to submit a pull request?

No

Code of Conduct

Yes

michelecos avatar Apr 11 '22 10:04 michelecos

This morning, I was able to overcome the problem unchecking "Automatically detect settings" from Proxy options, leaving only "Use setup script" checked and "Script location" filled

michelecos avatar Apr 11 '22 10:04 michelecos