Skip to content

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

Closed

Description

@minipotato

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.

Activity

  1. gorkem commented on Dec 6, 2016

    @gorkem
    Contributor

    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.

  2. minipotato commented on Dec 7, 2016

    @minipotato
    Author

    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

  3. gorkem commented on Feb 17, 2017

    @gorkem
    Contributor

    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?

  4. DFreds commented on Feb 22, 2017

    @DFreds

    This is happening to me as well.

  5. DFreds commented on Feb 23, 2017

    @DFreds

    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"
    }

  6. DFreds commented on Feb 23, 2017

    @DFreds

    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.

  7. TechMky commented on Mar 2, 2017

    @TechMky

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

  8. gorkem commented on Mar 2, 2017

    @gorkem
    Contributor

    @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

  9. TechMky commented on Mar 2, 2017

    @TechMky

    @gorkem This is what I was able to find

    Log.txt

  10. fbricon commented on Mar 2, 2017

    @fbricon
    Collaborator

    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.

  11. TechMky commented on Mar 3, 2017

    @TechMky

    @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.

  12. fbricon commented on Mar 3, 2017

    @fbricon
    Collaborator

    @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.

  13. fbricon commented on Mar 3, 2017

    @fbricon
    Collaborator

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

  14. TechMky commented on Mar 3, 2017

    @TechMky

    Alright. Will do that and let you know.

  15. 47 remaining items

  16. dhruvgajwa commented on Nov 22, 2020

    @dhruvgajwa

    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.

  17. brunoborges commented on Aug 31, 2021

    @brunoborges

    @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'
    }
  18. fbricon commented on Aug 31, 2021

    @fbricon
    Collaborator

    @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

  19. brunoborges commented on Aug 31, 2021

    @brunoborges

    Confirming this was the.issue. thanks!

    I think this issue and other similar can be closed.

  20. roccqqck commented on Oct 22, 2021

    @roccqqck

    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
    
  21. mmarakas commented on Oct 27, 2021

    @mmarakas

    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.

  22. fbricon commented on Oct 27, 2021

    @fbricon
    Collaborator

    @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

  23. mmarakas commented on Oct 27, 2021

    @mmarakas

    @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.

  24. brunoborges commented on Oct 27, 2021

    @brunoborges

    @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.

  25. mhenneke commented on Jan 20, 2022

    @mhenneke

    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.

  26. wduminy commented on May 11, 2022

    @wduminy

    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.

  27. robstryker commented on Oct 28, 2026

    @robstryker
    Contributor

    Many workarounds are listed in this issue here, and the NPE regarding logInfo has been fixed. Closing this issue since there's been no activity for years.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions