javavscode icon indicating copy to clipboard operation
javavscode copied to clipboard

Extension fails to start

Open anthonyvdotbe opened this issue 1 year ago • 9 comments

When I open VS Code, I see the following errors and the extension fails to start. (And yes, C:\dev\jdk-21.0.2 contains a valid JDK installation.)

image

extension: 1.0.0 VS Code: 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681) OS: Windows_NT x64 10.0.22631

Log:

Initiating server activation
Request to kill LSP server.
Cannot kill: current process is None
Launching Oracle Java SE Language Server with C:\dev\jdk-21.0.2 and userdir c:\Users\antho\AppData\Roaming\Code\User\workspaceStorage\a3a1ac302a43d9d618aae91e36299438\Oracle.oracle-java
LSP server launching: 13732
LSP server user directory: c:\Users\antho\AppData\Roaming\Code\User\workspaceStorage\a3a1ac302a43d9d618aae91e36299438\Oracle.oracle-java
-------------------------------------------------------------------------------
>Log Session: Monday, January 29, 2024, 11:18:18 AM Central European Standard Time
>System Info: 
  Product Version         = vsc dev-0cdb2f58d52f66abcc50da68aadc9c93bd94c2f8
  Operating System        = Windows 11 version 10.0 running on amd64
  Java; VM; Vendor        = 21.0.2; Java HotSpot(TM) 64-Bit Server VM 21.0.2+13-LTS-58; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 21.0.2+13-LTS-58
  Java Home               = C:\dev\jdk-21.0.2
  System Locale; Encoding = en_US (nbcode); UTF-8
  Home Directory          = C:\Users\antho
  Current Directory       = c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode
  User Directory          = C:\Users\antho\AppData\Roaming\Code\User\workspaceStorage\a3a1ac302a43d9d618aae91e36299438\Oracle.oracle-java\userdir
  Cache Directory         = C:\Users\antho\AppData\Roaming\Code\User\workspaceStorage\a3a1ac302a43d9d618aae91e36299438\Oracle.oracle-java\userdir\var\cache
  Installation            = C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform
                            C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\ide
                            C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\extide
                            C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\webcommon
                            C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\java
                            C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\nbcode
                            c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform
  Boot & Ext. Classpath   = 
  Application Classpath   = c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\lib\boot.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\lib\org-openide-modules.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\lib\org-openide-util-lookup.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\lib\org-openide-util-ui.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\lib\org-openide-util.jar
  Startup Classpath       = c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\asm-9.5.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\asm-commons-9.5.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\asm-tree-9.5.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\core-base.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\core.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\org-netbeans-libs-asm.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\org-openide-filesystems-compat8.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\core\org-openide-filesystems.jar;c:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\nbcode\core\locale\core_nbcode.jar
-------------------------------------------------------------------------------
java.lang.NullPointerException: Cannot invoke "org.osgi.framework.Bundle.getEntry(String)" because "b" is null
	at org.netbeans.core.netigso.Netigso.findResources(Netigso.java:383)
	at org.netbeans.NetigsoModule.findResources(NetigsoModule.java:152)
	at org.netbeans.core.startup.NbInstaller.loadLayers(NbInstaller.java:605)
	at org.netbeans.core.startup.NbInstaller.loadImpl(NbInstaller.java:332)
	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:420)
	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:404)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:424)
	at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:319)
	at org.netbeans.ModuleManager.doEnable(ModuleManager.java:1507)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1350)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1275)
	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:316)
	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:252)
	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:298)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:173)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:142)
	at org.netbeans.core.startup.Main.start(Main.java:303)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
	at java.base/java.lang.Thread.run(Thread.java:1583)
INFO [org.netbeans.modules.netbinox]: Install area set to file:/c:/Users/antho/.vscode/extensions/oracle.oracle-java-1.0.0/nbcode/
Warning - could not install some modules:
	net.java.html.json - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\net-java-html-json.jar: Not found bundle:net.java.html.json
	org.netbeans.html.ko4j - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-netbeans-html-ko4j.jar: Not found bundle:org.netbeans.html.ko4j
	org.netbeans.html.presenters.spi - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-netbeans-html-presenters-spi.jar: Not found bundle:org.netbeans.html.presenters.spi
	org.apache.commons.codec - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-apache-commons-codec.jar: Not found bundle:org.apache.commons.codec
	net.java.html.boot - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\net-java-html-boot.jar: Not found bundle:net.java.html.boot
	slf4j.api - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\ide\modules\slf4j-api.jar: Not found bundle:slf4j.api
	org.apache.commons.logging - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-apache-commons-logging.jar: Not found bundle:org.apache.commons.logging
	com.google.gson - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\ide\modules\com-google-gson.jar: Not found bundle:com.google.gson
	net.java.html - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\net-java-html.jar: Not found bundle:net.java.html
	slf4j.jdk14 - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\ide\modules\slf4j-jdk14.jar: Not found bundle:slf4j.jdk14
	org.netbeans.html.xhr4j - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-netbeans-html-xhr4j.jar: Not found bundle:org.netbeans.html.xhr4j
	org.apache.commons.lang3 - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-apache-commons-lang3.jar: Not found bundle:org.apache.commons.lang3
Warning - could not install some modules:
	net.java.html.json - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\net-java-html-json.jar: Not found bundle:net.java.html.json
	org.netbeans.html.ko4j - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-netbeans-html-ko4j.jar: Not found bundle:org.netbeans.html.ko4j
	org.netbeans.html.presenters.spi - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-netbeans-html-presenters-spi.jar: Not found bundle:org.netbeans.html.presenters.spi
	org.apache.commons.codec - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-apache-commons-codec.jar: Not found bundle:org.apache.commons.codec
	net.java.html.boot - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\net-java-html-boot.jar: Not found bundle:net.java.html.boot
	slf4j.api - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\ide\modules\slf4j-api.jar: Not found bundle:slf4j.api
	org.apache.commons.logging - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-apache-commons-logging.jar: Not found bundle:org.apache.commons.logging
	com.google.gson - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\ide\modules\com-google-gson.jar: Not found bundle:com.google.gson
	net.java.html - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\net-java-html.jar: Not found bundle:net.java.html
	slf4j.jdk14 - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\ide\modules\slf4j-jdk14.jar: Not found bundle:slf4j.jdk14
	org.netbeans.html.xhr4j - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-netbeans-html-xhr4j.jar: Not found bundle:org.netbeans.html.xhr4j
	org.apache.commons.lang3 - org.netbeans.InvalidException: Netigso: C:\Users\antho\.vscode\extensions\oracle.oracle-java-1.0.0\nbcode\platform\modules\org-apache-commons-lang3.jar: Not found bundle:org.apache.commons.lang3
WARNING [org.netbeans.core.modules]: the modules [org.netbeans.modules.xml.text] use org.netbeans.modules.editor.deprecated.pre65formatting which is deprecated.
WARNING [org.netbeans.core.modules]: the modules [org.netbeans.modules.xml.text] use org.netbeans.modules.editor.structure which is deprecated.
WARNING [org.netbeans.core.modules]: the modules [org.netbeans.modules.java.hints, org.netbeans.modules.java.lsp.server, org.netbeans.modules.maven.hints] use org.netbeans.modules.java.hints.legacy.spi which is deprecated: Use Java Hints SPI (org.netbeans.spi.java.hints) instead.
Cannot find org.netbeans.modules.java.lsp.server in the log!
Request to kill LSP server.
Cannot kill: Requested kill on 13732, current process is None
Oracle Java SE Language Server not enabled!

anthonyvdotbe avatar Jan 29 '24 10:01 anthonyvdotbe

Hey @anthonyvdotbe, Can you try removing c:\Users\antho\AppData\Roaming\Code\User\workspaceStorage\a3a1ac302a43d9d618aae91e36299438\Oracle.oracle-java directory, then restart the vscode and check if it resolves the issue ?

Achal1607 avatar Jan 29 '24 10:01 Achal1607

That works. I assume it's due to the fact that I deleted the previous JDK installation at C:\dev\jdk-21.0.1. Either way, the extension should handle this case automatically.

anthonyvdotbe avatar Jan 29 '24 11:01 anthonyvdotbe

The extension is marketed as a better replacement to the RedHat one, and this is the setup experience?

StanFromTraction avatar Mar 21 '24 09:03 StanFromTraction

#124 is the fix that is merged for troubleshooting such issues, hope it helps everyone. It would be available in next release.

Achal1607 avatar Mar 22 '24 06:03 Achal1607

@Achal1607 Please consider reopening. The whole point is that the extension should do this automatically: the extension was able to show me the error/notification dialogs, so it knows the extension is unusable and could simply delete the cache itself in an attempt to recover.

anthonyvdotbe avatar Mar 22 '24 06:03 anthonyvdotbe

The dialog could probably have a CTA that directly runs the cache clearing

StanFromTraction avatar Mar 23 '24 17:03 StanFromTraction

@Achal1607 Please consider reopening. The whole point is that the extension should do this automatically: the extension was able to show me the error/notification dialogs, so it knows the extension is unusable and could simply delete the cache itself in an attempt to recover.

We wouldn't prefer to delete cache without user's permission so automatically deleting would probably be not possible but what @StanFromTraction is saying we can try that.

Achal1607 avatar Mar 25 '24 08:03 Achal1607

Automatically deleting the cache without user's permission doesn't seem right and providing dialog box to clear cache for any type of failure to start the extension also doesn't sound that great. So, for now in my opinion we have added the troubleshoot section in the README file and a command to clear the cache is enough.

Achal1607 avatar May 10 '24 06:05 Achal1607

For the particular error I reported, the extension should not give an error in the first place & simply be able to locate the JDK. For startup errors in general, I'd definitely wish the extension would be more helpful. The error notification should at least refer to the Troubleshooting section in the README or mention the "clear cache" command.

anthonyvdotbe avatar May 10 '24 20:05 anthonyvdotbe

Closing this issue as we have added "clear cache" command, also in the output logs you can see that refer to troublshooting section if your extension fails to start, but other than that at the moment we don't want to change UI or delete cache files directly.

Achal1607 avatar Jun 17 '24 10:06 Achal1607