Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted. #112

Open
minipotato opened this issue Dec 6, 2016 · 70 comments

Comments

@minipotato
Copy link

This extension cannot start successfully and popup this error message. I found some logs in the output, hope it can help:
[Info - 11:24:22 AM] Connection to server got closed. Server will restart.
[Info - 11:24:23 AM] Connection to server got closed. Server will restart.
[Warn - 11:24:24 AM] Dec 6, 2016 11:24:24 AM The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
[Info - 11:24:25 AM] Connection to server got closed. Server will restart.
[Warn - 11:24:26 AM] Dec 6, 2016 11:24:26 AM The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
[Info - 11:24:26 AM] Connection to server got closed. Server will restart.
[Warn - 11:24:27 AM] Dec 6, 2016 11:24:27 AM The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
[Error - 11:24:27 AM] Connection to server got closed. Server will not be restarted.

Environment
  • Operating System: Windows 7 Enterprise
  • JDK version: 1.8.0_40 (Setting JAVA_HOME environment variable only)
  • Visual Studio Code version: 1.7.2
  • Java extension version: 0.0.7
Steps To Reproduce
  1. Download and install vscode 1.7.2
  2. Search and install this extension: Language Support for Java(TM) by Red Hat
  3. Open a .java file to start this extension
  4. (Optional) Check the popup message and output logs
Additional Informations

I installed the same-version vscode and extension to another machine whose system is Windows 10, and the extension can work as expected.

@gorkem
Copy link
Contributor

gorkem commented Dec 6, 2016

Can you set java.trace setting to verbose this will dump all the communication between the server and vscode to console. It can give us a hint on what is causing the problem.

@minipotato
Copy link
Author

minipotato commented Dec 7, 2016

Hi @gorkem ,

I found the log file finally, you can check this:

!ENTRY org.eclipse.core.resources 2 10035 2016-12-07 22:49:07.452
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.core.jobs 4 2 2016-12-07 22:49:15.419
!MESSAGE An internal error occurred during: "Initialize Workspace".
!STACK 0
java.lang.NullPointerException
	at org.jboss.tools.vscode.java.internal.JavaLanguageServerPlugin.logInfo(JavaLanguageServerPlugin.java:98)
	at org.jboss.tools.vscode.java.internal.managers.ProjectsManager.createProject(ProjectsManager.java:66)
	at org.jboss.tools.vscode.java.internal.handlers.InitHandler$1.run(InitHandler.java:89)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.core.resources 4 2 2016-12-07 22:49:15.457
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.internal.launching.LaunchingPlugin.readInstallInfo(LaunchingPlugin.java:1008)
	at org.eclipse.jdt.internal.launching.LaunchingPlugin.timeStampChanged(LaunchingPlugin.java:980)
	at org.eclipse.jdt.internal.launching.VMDefinitionsContainer.populateVMForType(VMDefinitionsContainer.java:557)
	at org.eclipse.jdt.internal.launching.VMDefinitionsContainer.populateVMTypes(VMDefinitionsContainer.java:494)
	at org.eclipse.jdt.internal.launching.VMDefinitionsContainer.parseXMLIntoContainer(VMDefinitionsContainer.java:473)
	at org.eclipse.jdt.launching.JavaRuntime.addPersistedVMs(JavaRuntime.java:1499)
	at org.eclipse.jdt.launching.JavaRuntime.initializeVMs(JavaRuntime.java:2671)
	at org.eclipse.jdt.launching.JavaRuntime.getVMInstallTypes(JavaRuntime.java:539)
	at org.eclipse.jdt.internal.launching.environments.EnvironmentsManager.initializeCompatibilities(EnvironmentsManager.java:241)
	at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironment.init(ExecutionEnvironment.java:181)
	at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironment.getDefaultVM(ExecutionEnvironment.java:223)
	at org.eclipse.jdt.internal.launching.JREContainerInitializer.resolveVM(JREContainerInitializer.java:176)
	at org.eclipse.jdt.internal.launching.JREContainerInitializer.resolveVM(JREContainerInitializer.java:143)
	at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize(JREContainerInitializer.java:60)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2939)
	at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1970)
	at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:3424)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2693)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2857)
	at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1962)
	at org.eclipse.jdt.internal.core.ExternalFoldersManager.refreshReferences(ExternalFoldersManager.java:393)
	at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1996)
	at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:477)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:299)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:289)
	at org.eclipse.core.internal.events.NotificationManager.handleEvent(NotificationManager.java:273)
	at org.eclipse.core.internal.resources.Workspace.broadcastEvent(Workspace.java:369)
	at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1593)
	at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:163)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Thanks

@gorkem
Copy link
Contributor

gorkem commented Feb 17, 2017

This log indicates that the plugins are not successfully started. I am not sure what can be causing this. Do you still see this behaviour?

@DFreds
Copy link

DFreds commented Feb 22, 2017

This is happening to me as well.

@DFreds
Copy link

DFreds commented Feb 23, 2017

I tried uninstalling and reinstalling the extension and I still get the issue. I also tried restarting my computer and that didn't do anything.

The only thing I can think of is that it was working until I did a Cmd+Shift+W to close code. The next time I started, I got the issue.

Here is the console log output I get in the developer tools.

[Extension Host] Executing /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java -Declipse.application=org.jboss.tools.vscode.java.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.jboss.tools.vscode.java.product -noverify -Xmx1G -jar /my/username/.vscode/extensions/redhat.java-0.0.10/server/plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar -configuration /my/username/.vscode/extensions/redhat.java-0.0.10/server/config_mac -data /my/username/Library/Application Support/Code/User/workspaceStorage/9fa792d955d2020374db01e716195cb2/redhat.java/jdt_ws

//Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js:100 The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.

I also get this in the Output window:

[Info - 12:44:19 PM] Connection to server got closed. Server will restart.
[Trace - 12:44:20 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 2318,
"rootPath": "/path/to/repo",
"capabilities": {},
"trace": "verbose"
}

@DFreds
Copy link

DFreds commented Feb 23, 2017

I got this to work again by wiping out my repository and forcing it to regenerate all of the eclipse .prefs files. Not sure how any of it got messed up, but it's a workaround at least.

@TechMky
Copy link

TechMky commented Mar 2, 2017

Me too.. I've tried most of the things listed on the Internet and none of them seems to solve this problem.

@gorkem
Copy link
Contributor

gorkem commented Mar 2, 2017

@TechMky Can you find the logs and post them here? they should be in a directory ~/${APP_DATA}/workspaceStorage/${WORKSPACE_HASH}/redhat.java/jdt_ws/.metadata

@TechMky
Copy link

TechMky commented Mar 2, 2017

@gorkem This is what I was able to find

Log.txt

@fbricon
Copy link
Collaborator

fbricon commented Mar 2, 2017

It looks like the exception thrown while calling JavaLanguageServerPlugin.logInfo is caused by having a null context, which would be caused by the plugin being stopped at that point. So I doubt the exception causes the problem, but is rather a symptom of the server being stopped prematurely.

I have no clue why. Best I can think of right now, is to add some more logging to try to determine what causes the server to stop.

@TechMky
Copy link

TechMky commented Mar 3, 2017

@fbricon

Alright. I'll give it some time and try to generate more log data. I tried making sense of log files but wasn't able to. I hope that the RedHat team can provide me some solution regarding this issue.

@fbricon
Copy link
Collaborator

fbricon commented Mar 3, 2017

@TechMky the Red Hat team (@gorkem and I) have released v0.0.11. This should gives us more logging in case the problem still persists. Please give it a try.

@fbricon
Copy link
Collaborator

fbricon commented Mar 3, 2017

Please delete ~/${APP_DATA}/workspaceStorage/, so you get clean logs

@TechMky
Copy link

TechMky commented Mar 3, 2017

Alright. Will do that and let you know.

@TechMky
Copy link

TechMky commented Mar 4, 2017

@fbricon
This is the error generated after updating.

screenshot 9

Also here are the new log files.
Log2.txt

@ofir-popowski
Copy link

Is there any update regarding this issue ? I am experiencing exactly the same thing.

@fbricon
Copy link
Collaborator

fbricon commented Jul 5, 2017

@ofir-popowski can you attach the vscode-java and server logs?

@ofir-popowski
Copy link

ofir-popowski commented Jul 6, 2017

@fbricon
log.txt

[Extension Host] Executing C:\Program Files\Java\jdk1.8.0_121\bin\java 
-Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 
-Declipse.product=org.eclipse.jdt.ls.core.product -noverify -Xmx1G -XX:+UseG1GC 
-XX:+UseStringDeduplication -jar C:\Users\Ofir\.vscode\extensions\redhat.java-0.7.0\server\plugins
\org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar -configuration C:\Users\Ofir\.vscode\extensions
\redhat.java-0.7.0\server\config_win -data C:\Users\Ofir\AppData\Roaming\Code\User\workspaceStorage
\08ac042071217d6e26caabeae7ca1196\redhat.java\jdt_ws

I couldn't see anything else in the console in the developer tools part (except some warning regarding keyboard shortcuts on windows. If it's important I'll put it here)

@fbricon
Copy link
Collaborator

fbricon commented Jul 7, 2017

looks to me like the server receives a kill signal, but it's not coming from vscode. Something is stopping the Java process but I have no idea what. Do you have some kind of antivirus running?

@gorkem @snjeza ideas?

@ofir-popowski
Copy link

ofir-popowski commented Jul 7, 2017

I have no antivirus at all (except windows defender thing), and system path properly configured to JDK. I also have several other IDEs that use java and I don't have any other issues.

Let me know if there's anything I can do to help figure this out.

Is it possible that having another IDE active while trying to launch vscode is the problem ? (different maven java projects)

@fbricon
Copy link
Collaborator

fbricon commented Jul 7, 2017

@ofir-popowski no, other IDEs should not interfere.

Do you think you could try to debug vscode-java yourself? (since we can't reproduce, it's hard to guess what's happening). If you're up to the task, you could follow the instructions to launch vscode-java from vscode, and put a breakpoint in https://github.com/redhat-developer/vscode-java/blob/master/src/javaServerStarter.ts#L55, see what happens

@ofir-popowski
Copy link

ofir-popowski commented Jul 8, 2017

@fbricon Ok I cloned the repo, opened it with vscode, launched in debug and it stopped. It launched and I opened a java project.

When it stopped, err was null, I stepped over several times. It got to <node_internals>\net.js#L1455 and it got to the breakpoint again, but the new vscode project window had this log:

log2.txt

I don't know much javascript, so I'm not sure I can help more than that but I'll do my best. If there's anything specific I should be looking for, please let me know.

I'd like to point out that the project I'm trying to open is not an eclipse project (no eclipse files anywhere), just a java maven project.

Edit: I just tried removing and completely purging all vscode stuff from my machine, and reinstalled. Problem persists on my work machine, but sadly I cannot reproduce on my PC at home with same versions of OS, JDK, project, and extensions.

@fbricon
Copy link
Collaborator

fbricon commented Jul 5, 2019

To anyone seeing this issue, please report the logs you find in your extensions folder:
<home directory>/.vscode/extensions/redhat.java-***/server/config_<your_platform>/

@morrystore
Copy link

My win7 PC installed jdk with (jdk1.8.0 and jdk1.8.0_121 )
First , I used the jdk1.8.0 to config the setting.json (java.home), the problem was happened.
But ,when I used the jdk1.8.0_121 to config it , the plugin can work as expected.

@tommai78101
Copy link

Update: I tried installing vscode-lombok, but I found out we never use Lombok at all, so there's no point in installing it.

However, I did notice there's this error log here mentioning about a BundleContext no longer being valid for the redhat-vscode-java plugin:

!ENTRY org.eclipse.osgi 4 0 2020-07-02 09:03:31.971
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.jdt.ls.core was unable to load class org.eclipse.jdt.ls.core.internal.LanguageServer.
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:212)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:198)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:923)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.ls.core (47).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:126)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:477)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:620)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
	... 16 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start() of bundle org.eclipse.jdt.ls.core.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:864)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:792)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
	at org.eclipse.osgi.container.Module.doStart(Module.java:605)
	at org.eclipse.osgi.container.Module.start(Module.java:468)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
	... 24 more
Caused by: java.lang.IllegalStateException: BundleContext is no longer valid org.eclipse.jdt.ls.core_0.57.0.202006172050 [47]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.checkValid(BundleContextImpl.java:1056)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.getBundle(BundleContextImpl.java:168)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.logException(JavaLanguageServerPlugin.java:428)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start(JavaLanguageServerPlugin.java:157)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:843)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835)
	... 31 more

And a few more entries about very similar things:

!ENTRY org.eclipse.osgi 4 0 2020-07-02 09:03:31.964
!MESSAGE An error occurred while automatically activating bundle org.eclipse.jdt.ls.core (47).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start() of bundle org.eclipse.jdt.ls.core.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:864)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:792)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
	at org.eclipse.osgi.container.Module.doStart(Module.java:605)
	at org.eclipse.osgi.container.Module.start(Module.java:468)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:477)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:620)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:923)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Caused by: java.lang.IllegalStateException: BundleContext is no longer valid org.eclipse.jdt.ls.core_0.57.0.202006172050 [47]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.checkValid(BundleContextImpl.java:1056)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.getBundle(BundleContextImpl.java:168)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.logException(JavaLanguageServerPlugin.java:428)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start(JavaLanguageServerPlugin.java:157)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:843)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835)
	... 31 more
Root exception:
java.lang.IllegalStateException: BundleContext is no longer valid org.eclipse.jdt.ls.core_0.57.0.202006172050 [47]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.checkValid(BundleContextImpl.java:1056)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.getBundle(BundleContextImpl.java:168)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.logException(JavaLanguageServerPlugin.java:428)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start(JavaLanguageServerPlugin.java:157)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:843)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:792)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
	at org.eclipse.osgi.container.Module.doStart(Module.java:605)
	at org.eclipse.osgi.container.Module.start(Module.java:468)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:477)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:620)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:923)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

@dupinder
Copy link

dupinder commented Jul 8, 2020

But it is working fine after installing vs-lambok, I don't know why, but yes it is working fine. Please help to understand why lambok is resolving the error ?

@tommai78101
Copy link

But it is working fine after installing vs-lambok, I don't know why, but yes it is working fine. Please help to understand why lambok is resolving the error ?

No, it didn't actually work for me, even with "vscode-lombok" extension installed.

@fjvela
Copy link

fjvela commented Jul 14, 2020

Same problem here, new PC installation. I tried to install "vscode-lombok" but it doesn't work for me.

Version: 1.47.0 (user setup) Commit: d5e9aa0227e057a60c82568bf31c04730dc15dcd Date: 2020-07-09T08:02:06.629Z (4 days ago) Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18363

vscode_java_error.txt

@tommai78101
Copy link

Has the Java RE version requirements been increased to require at least OpenJDK 12.0 or up?

I'm starting to think Java 8 is no longer compatible with the latest VS Code.

@dupinder
Copy link

dupinder commented Jul 14, 2020

I am using OpenJDK 11 BTW.

Now I just uninstall the lombok extension and created one java file and boom again

!SESSION 2020-07-08 14:19:37.520 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -data c:\Users\DupinderDhiman\AppData\Roaming\Code\User\workspaceStorage\4e625fc2a7de9452fc01413556afae12\redhat.java\jdt_ws

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.111
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.398
!MESSAGE Main thread is waiting

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.463
!MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.482
!MESSAGE Initializing Java Language Server 0.58.0.202007061829

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.615
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.617
!MESSAGE Non-Static Commands: [java.edit.organizeImports, java.project.refreshDiagnostics, java.project.import, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.provideSemanticTokens, java.project.getAll, java.project.isTestFile, java.project.getClasspaths, java.project.getSemanticTokensLegend, java.project.getSettings, java.project.updateSourceAttachment, java.project.resolveSourceAttachment, java.project.addToSourcePath]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.619
!MESSAGE Static Commands: [sts.java.addClasspathListener, sts.java.removeClasspathListener]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.620
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.635
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.638
!MESSAGE Non-Static Commands: [sts.java.javadoc]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.639
!MESSAGE Static Commands: [sts.java.type]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.640
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.641
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.645
!MESSAGE Non-Static Commands: [sts.java.javadocHoverLink]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.648
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.650
!MESSAGE Non-Static Commands: [sts.java.location]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.651
!MESSAGE Static Commands: [sts.java.search.packages, sts.java.search.types]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.652
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.653
!MESSAGE Static Commands: [sts.java.hierarchy.supertypes, sts.java.hierarchy.subtypes]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.655
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.656
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.656
!MESSAGE Non-Static Commands: [sts.java.code.completions]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.658
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.658
!MESSAGE Non-Static Commands: [java.intellicode.completion, java.intellicode.completion.resolve, java.intellicode.enable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.659
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.661
!MESSAGE Non-Static Commands: [vscode.java.checkProjectSettings, vscode.java.isOnClasspath, vscode.java.fetchUsageData, vscode.java.validateLaunchConfig, vscode.java.resolveMainMethod, vscode.java.resolveClasspath, vscode.java.resolveBuildFiles, vscode.java.resolveMainClass, vscode.java.updateDebugSettings, vscode.java.fetchPlatformSettings, vscode.java.buildWorkspace, vscode.java.startDebugSession, vscode.java.inferLaunchCommandLength, vscode.java.resolveElementAtSelection, vscode.java.resolveJavaExecutable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.663
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.664
!MESSAGE Non-Static Commands: [java.project.refreshLib, java.project.list, java.getPackageData, java.resolvePath]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.665
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.668
!MESSAGE Non-Static Commands: [vscode.java.test.search.codelens, vscode.java.test.search.items.all, vscode.java.test.search.location, vscode.java.test.search.items, vscode.java.test.get.testpath, vscode.java.test.junit.argument]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.670
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.673
!MESSAGE Non-Static Commands: [java.maven.initializeSearcher, java.maven.searchArtifact, java.maven.addDependency, java.maven.controlContext]

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.708
!MESSAGE >> initialized

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:52.793
!MESSAGE Creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:53.042
!MESSAGE Finished creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.296
!MESSAGE Try to create an invisible project for the workspace E:/Projects/stackoverflow/javaExample/SOjavaExample

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.299
!MESSAGE Creating the Java project SOjavaExample_416796a5

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.486
!MESSAGE Finished creating the Java project SOjavaExample_416796a5

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.553
!MESSAGE Successfully created a workspace invisible project SOjavaExample_416796a5

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.556
!MESSAGE Workspace initialized in 2878ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.605
!MESSAGE >> initialization job finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.657
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.788
!MESSAGE >> New configuration: {java={home=E:\Open_JDK\openjdk-11.0.2_windows-x64_bin\jdk-11.0.2, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:"c:\Users\DupinderDhiman.vscode\extensions\gabrielbb.vscode-lombok-1.0.1\server\lombok.jar"}}, errors={incompleteClasspath={severity=warning}}, configuration={checkProjectSettingsExclusions=true, updateBuildConfiguration=interactive, maven={userSettings=null}, runtimes=[]}, trace={server=off}, import={maven={enabled=true}, gradle={enabled=true, wrapper={enabled=true}, offline={enabled=false}, version=null, arguments=null, jvmArguments=null, home=null, user={home=null}}, exclusions=[/node_modules/, /.metadata/, /archetype-resources/, /META-INF/maven/]}, maven={downloadSources=false, updateSnapshots=false}, referencesCodeLens={enabled=false}, signatureHelp={enabled=false}, implementationsCodeLens={enabled=false}, format={enabled=true, settings={url=null, profile=}, comments={enabled=true}, onType={enabled=true}}, saveActions={organizeImports=false}, project={referencedLibraries=[lib/**/.jar], importOnFirstTimeStartup=interactive, importHint=true}, contentProvider={preferred=}, autobuild={enabled=false}, maxConcurrentBuilds=1.0, completion={maxResults=0.0, enabled=true, overwrite=true, guessMethodArguments=false, favoriteStaticMembers=[org.junit.Assert., org.junit.Assume., org.junit.jupiter.api.Assertions., org.junit.jupiter.api.Assumptions., org.junit.jupiter.api.DynamicContainer., org.junit.jupiter.api.DynamicTest., org.mockito.Mockito., org.mockito.ArgumentMatchers., org.mockito.Answers.], filteredTypes=[java.awt., com.sun.], importOrder=[java, javax, com, org]}, foldingRange={enabled=true}, progressReports={enabled=true}, codeGeneration={hashCodeEquals={useJava7Objects=false, useInstanceof=false}, useBlocks=false, generateComments=false, toString={template=${object.className} [${member.name()}=${member.value}, ${otherMembers}], codeStyle=STRING_CONCATENATION, skipNullValues=false, listArrayContents=true, limitElements=0.0}}, selectionRange={enabled=true}, showBuildStatusOnStart={enabled=false}, server={launchMode=Hybrid}, sources={organizeImports={starThreshold=99.0, staticStarThreshold=99.0}}, semanticHighlighting={enabled=true}, requirements={JDK11Warning=true}, refactor={renameFromFileExplorer=prompt}, imports={gradle={wrapper={checksums=[]}}}, debug={logLevel=warn, settings={showHex=false, showStaticVariables=false, showQualifiedNames=false, showLogicalStructure=true, showToString=true, maxStringLength=0.0, numericPrecision=0.0, hotCodeReplace=manual, enableRunDebugCodeLens=true, forceBuildBeforeLaunch=true, console=integratedTerminal}}, dependency={showMembers=false, syncWithFolderExplorer=true, autoRefresh=true, refreshDelay=2000.0, packagePresentation=flat}, help={firstView=gettingStarted}, test={report={showAfterExecution=onFailure, position=sideView}, editor={enableShortcuts=true}, log={level=info}, message={hintForDeprecatedConfig=true, hintForSetingDefaultConfig=true}, defaultConfig=, config={}}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.791
!MESSAGE >> document/didOpen

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:55.881
!MESSAGE >> Updating classpath for project SOjavaExample_416796a5

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:56.127
!MESSAGE >> workspace/executeCommand java.intellicode.enable

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:56.137
!MESSAGE >> workspace/executeCommand java.project.isTestFile

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:56.150
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:56.153
!MESSAGE Reconciled 0. Took 4 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:56.193
!MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:56.195
!MESSAGE >> document/foldingRange

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:56.209
!MESSAGE >> workspace/executeCommand java.project.getSettings

!ENTRY java-debug 1 0 2020-07-08 14:19:56.289
!MESSAGE Starting com.microsoft.java.debug.plugin

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.404
!MESSAGE begin problem for /B.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.405
!MESSAGE 0 problems reported for /B.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.425
!MESSAGE Validated 1. Took 1216 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.477
!MESSAGE >> build jobs finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.508
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.583
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.587
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:19:57.590
!MESSAGE >> watchers registered

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:01.691
!MESSAGE >> document/documentHighlight

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:01.694
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.113
!MESSAGE >> workspace/executeCommand java.project.getClasspaths

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.256
!MESSAGE >> workspace/executeCommand vscode.java.test.get.testpath

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.387
!MESSAGE >> workspace/executeCommand java.project.getAll

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.514
!MESSAGE >> workspace/executeCommand java.project.getSemanticTokensLegend

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.594
!MESSAGE >> workspace/executeCommand java.project.getSettings

!ENTRY org.eclipse.jdt.ls.core 4 2 2020-07-08 14:20:02.673
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
!STACK 1
org.eclipse.core.runtime.CoreException: Given URI does not belong to any Java project.
at org.eclipse.jdt.ls.core.internal.commands.ProjectCommand.getJavaProjectFromUri(ProjectCommand.java:257)
at org.eclipse.jdt.ls.core.internal.commands.ProjectCommand.getProjectSettings(ProjectCommand.java:82)
at org.eclipse.jdt.ls.core.internal.JDTDelegateCommandHandler.executeCommand(JDTDelegateCommandHandler.java:65)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:215)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:205)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$3(JDTLanguageServer.java:495)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
!SUBENTRY 1 org.eclipse.jdt.ls.core 4 0 2020-07-08 14:20:02.675
!MESSAGE Given URI does not belong to any Java project.
!SUBENTRY 1 org.eclipse.jdt.ls.core 4 0 2020-07-08 14:20:02.675
!MESSAGE Given URI does not belong to any Java project.

!ENTRY org.eclipse.jdt.ls.core 4 0 2020-07-08 14:20:02.679
!MESSAGE Error in calling delegate command handler
!STACK 1
org.eclipse.core.runtime.CoreException: Given URI does not belong to any Java project.
at org.eclipse.jdt.ls.core.internal.commands.ProjectCommand.getJavaProjectFromUri(ProjectCommand.java:257)
at org.eclipse.jdt.ls.core.internal.commands.ProjectCommand.getProjectSettings(ProjectCommand.java:82)
at org.eclipse.jdt.ls.core.internal.JDTDelegateCommandHandler.executeCommand(JDTDelegateCommandHandler.java:65)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:215)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:205)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$3(JDTLanguageServer.java:495)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
!SUBENTRY 1 org.eclipse.jdt.ls.core 4 0 2020-07-08 14:20:02.679
!MESSAGE Given URI does not belong to any Java project.

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.757
!MESSAGE >> document/foldingRange

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.758
!MESSAGE >> document/hover

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.799
!MESSAGE >> workspace/executeCommand vscode.java.test.search.codelens

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:02.800
!MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:03.024
!MESSAGE >> workspace/executeCommand java.project.provideSemanticTokens

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:03.026
!MESSAGE >> document/hover

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:03.132
!MESSAGE >> java/findLinks

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:05.981
!MESSAGE >> workspace/executeCommand vscode.java.test.search.codelens

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:05.983
!MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:08.236
!MESSAGE >> workspace/executeCommand vscode.java.isOnClasspath

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:08.768
!MESSAGE >> workspace/executeCommand vscode.java.updateDebugSettings

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:08.786
!MESSAGE >> java/buildWorkspace (incremental)

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:10.705
!MESSAGE >> workspace/executeCommand vscode.java.validateLaunchConfig

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:10.716
!MESSAGE >> workspace/executeCommand vscode.java.resolveClasspath

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:10.904
!MESSAGE >> workspace/executeCommand vscode.java.resolveJavaExecutable

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:10.915
!MESSAGE >> workspace/executeCommand vscode.java.checkProjectSettings

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:12.197
!MESSAGE >> workspace/executeCommand vscode.java.inferLaunchCommandLength

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:12.213
!MESSAGE >> workspace/executeCommand vscode.java.startDebugSession

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:15.669
!MESSAGE >> workspace/executeCommand vscode.java.fetchUsageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:21.074
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:24.931
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:24.933
!MESSAGE >> document/documentSymbol

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:25.226
!MESSAGE >> workspace/executeCommand vscode.java.test.search.codelens

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:25.229
!MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:25.381
!MESSAGE >> workspace/executeCommand sts.java.addClasspathListener

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:25.848
!MESSAGE >> workspace/executeCommand vscode.java.test.search.codelens

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:25.849
!MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:28.867
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:29.382
!MESSAGE >> document/hover

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:29.397
!MESSAGE >> java/findLinks

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:31.080
!MESSAGE >> document/hover

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:31.088
!MESSAGE >> java/findLinks

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:32.302
!MESSAGE >> document/didClose

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:33.216
!MESSAGE >> shutdown

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:33.220
!MESSAGE >> exit

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:33.468
!MESSAGE Shutdown received... waking up main thread

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-07-08 14:20:33.491
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is stopping:

@fjvela
Copy link

fjvela commented Jul 14, 2020

Same problem here, new PC installation. I tried to install "vscode-lombok" but it doesn't work for me.

Version: 1.47.0 (user setup) Commit: d5e9aa0227e057a60c82568bf31c04730dc15dcd Date: 2020-07-09T08:02:06.629Z (4 days ago) Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18363

vscode_java_error.txt

I fixed the problem (openjdk 8):

  • Uninstall visual code folowing these steps: https://superuser.com/a/1380253
  • Install visual code (system), then I installed java plugins:
    -- vscjava.vscode-java-debug
    -- vscjava.vscode-java-pack
    -- gabrielbb.vscode-lombok

@tommai78101
Copy link

Got any instructions for Ubuntu (Linux)?

@fjvela
Copy link

fjvela commented Jul 15, 2020

@testforstephen
Copy link
Collaborator

Just clarify the requirement about vscode-lombok extension.

  • If your project doesn't use any lombok annotation feature, you don't need install vscode-lombok extension.
  • When you installed vscode-lombok extension before, and uninstalled it recently, you must clean up the user setting java.jdt.ls.vmargs, too.
    • When you installed vscode-lombok, it will modify your user setting and append a parameter -javaagent:\"/Users/myName/.vscode-insiders/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar\"" to the jvmArgs.
    • When you uninstalled it, it won't remove the jvmArgs, that will cause the vscode-java broken because of lombok.jar not existing.

@tommai78101
Copy link

tommai78101 commented Jul 16, 2020

@testforstephen Where can I find the "jvmArgs" on both Windows and Ubuntu, so I can remove them or restore them to the default "jvmArgs" in the user settings? Thank you so much for the clarifications.

Maybe it's a good idea to include a way to inspect our current "jvmArgs" via the vscode-java extension. Just viewing it is fine, no need to do something fancy about it. Maybe it's suitable to put this in a separate feature enhancement ticket?

EDIT:

Oh, it's a VS Code User Settings... nevermind. I thought it's a setting that was permanently modified somewhere on my Windows and Ubuntu user profiles.

@al6x
Copy link

al6x commented Jul 20, 2020

Same problem Given URI does not belong to any Java project when I hit the "Run" button.

About the fix with uninstalling VSCode - is there other option, not requiring VSCode uninstall?

@tommai78101
Copy link

tommai78101 commented Jul 21, 2020

It seems there was an update of some sort to the Java JDT Core. This is my latest error log message.

!ENTRY org.eclipse.osgi 4 0 2020-07-21 09:09:12.636
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.jdt.ls.core was unable to load class org.eclipse.jdt.ls.core.internal.LanguageServer.
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:212)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:198)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:923)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.ls.core (47).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:126)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:477)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:620)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
	... 16 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start() of bundle org.eclipse.jdt.ls.core.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:864)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:792)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
	at org.eclipse.osgi.container.Module.doStart(Module.java:605)
	at org.eclipse.osgi.container.Module.start(Module.java:468)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
	... 24 more
Caused by: java.lang.IllegalStateException: BundleContext is no longer valid org.eclipse.jdt.ls.core_0.58.0.202007081640 [47]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.checkValid(BundleContextImpl.java:1056)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.getBundle(BundleContextImpl.java:168)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.logException(JavaLanguageServerPlugin.java:428)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start(JavaLanguageServerPlugin.java:157)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:843)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835)
	... 31 more

From my previous log that I posted earlier, I noticed these JDT versions are different, yet they continue to throw BundleContext not valid error:

Previous:

java.lang.IllegalStateException: BundleContext is no longer valid org.eclipse.jdt.ls.core_0.57.0.202006172050 [47]

Current:

java.lang.IllegalStateException: BundleContext is no longer valid org.eclipse.jdt.ls.core_0.58.0.202007081640 [47]

Where should I start looking into this BundleContext not being valid due to the version differences?

@fbricon
Copy link
Collaborator

fbricon commented Jul 21, 2020

try the "Java: clean the Java Language server workspace" command

@tommai78101
Copy link

tommai78101 commented Jul 21, 2020

@fbricon That solved my issue with the Language Support for Java server crashing each time I restarted VS Code. Thanks for this. I'll continue to monitor the log files, and if I see any messages that is not related to BundleContext, I'll post here again.

@dhruvgajwa
Copy link

Clean the workspace, either by command prompt or by deleting the "C:\Users\Dhruv\AppData\Roaming\Code\User" Folder. You can find the exact link for the folder in the debug log text.

@brunoborges
Copy link

@fbricon @akaroml it seems this error is constant now. Just tried to open a Java project on WSL and got the same issue. The logs indicate this is the root cause:

{
  message: 'Error opening zip file or JAR manifest missing : /home/codespace/.vscode-remote/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar\n',
  level: 'info',
  timestamp: '2021-08-31 12:41:43.946'
}

@fbricon
Copy link
Collaborator

fbricon commented Aug 31, 2021

@brunoborges the gabrielbb.vscode-lombok-1.0.1 changes the java.jdt.ls.vmargs value and sets the path to the lombok agent. Either remove it and disable the extension, or install the same extension both locally and on your remote instance

@brunoborges
Copy link

Confirming this was the.issue. thanks!

I think this issue and other similar can be closed.

@roccqqck
Copy link

roccqqck commented Oct 22, 2021

It is still happening when I coding in remote container.

But it worked fine when I use local vscode.

2021-10-11
mac docker desktop 4.1.1.69872
vscode 1.61.2
remote container 0.202.5
language support for java 1.0.0

@mmarakas
Copy link

Getting the same error intermittently when working on a remote ubuntu vm from macOS.

It works for some time ok and randomly it just stops working and the language server crashes constantly or can't start at all. Tried cleaning the workspace, removing/reinstalling extensions, reinstalling vscode, killing vscode-server running on the remote end, rebooting the vm, every possible cure I have seen in various issues here, all to no avail. It just starts working by itself after some random time, probably 1-2 days.

The weird thing is that if I create another ubuntu user and connect with vscode through that user, it works fine -for some time, until that breaks too.

The only meaningful log that seems to appear is on the developer tool, which shows the following, just before printing that the language server crashed:

Error: Message header must separate key and value using :
at a.tryReadHeaders (vscode-file://vscode-app/root/.vscode-server/extensions/redhat.java-1.0.0/dist/extension.js:2)
at p.onData (vscode-file://vscode-app/root/.vscode-server/extensions/redhat.java-1.0.0/dist/extension.js:2)
at Socket. (vscode-file://vscode-app/root/.vscode-server/extensions/redhat.java-1.0.0/dist/extension.js:2)
at Socket.emit (events.js:315)
at addChunk (internal/streams/readable.js:309)
at readableAddChunk (internal/streams/readable.js:284)
at Socket.Readable.push (internal/streams/readable.js:223)
at TCP.onStreamRead (internal/stream_base_commons.js:188)

Also you can find the server logs here after enabling trace logs, but don't think there is much to be seen there.

Really could use some help, since this has been torturing me for some days now and can't seem to find anything.

@fbricon
Copy link
Collaborator

fbricon commented Oct 27, 2021

@mmarakas does /home/makis/.vscode-server/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar actually exist? if not, you should remove the lombok javaagent from java.jdt.ls.vmargs

@mmarakas
Copy link

@mmarakas does /home/makis/.vscode-server/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar actually exist? if not, you should remove the lombok javaagent from java.jdt.ls.vmargs

Yes it exists, but even after removing the .vscode-server folder for both root and makis users, the language server still doesn't come up.

I even tried clearing the local vscode storage on macOS at ~/Library/Application Support/Code but nothing changed.

@brunoborges
Copy link

@mmarakas check if VS Code isn't syncing the settings with your account in the cloud somewhere. I kept getting Lombok agent in the vmargs because it was syncing.

@mhenneke
Copy link

For me the fix was removing the javaagent argument which was added to the vmargs in the settings.json .
It's still unclear why this lombar.jar was added. The project I'm working on doesn't use lombok.

Where to find the settings.json.
I'm on Mac so these steps might be a bit different on other system.

Goto Preferences -> Settings
In Settings goto Extensions -> Java
Scroll down and a few of the entries have a link which says Edit in settings.json .
Click on this link to open settings.json .
There should be a key which contains the vmargs: "java.jdt.ls.vmargs"
At the end of the defined value I found the javaagent which pointed to lombok.jar .
Remove this part.
It should now only say something like:
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m"
After altering this value, VScode will prompt you to restart.
When VScode had restarted the error was gone.

@wduminy
Copy link

wduminy commented May 11, 2022

I had a very similar error on macOS. It might have started happening after I upgraded VS Code.

What worked for me was to delete this directory:

~/Library/Application Support/Code/User/workspaceStorage

Warning: you will have to set up your workspaces after doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests