vscode-java
vscode-java copied to clipboard
Error: The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.
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
- Download and install vscode 1.7.2
- Search and install this extension: Language Support for Java(TM) by Red Hat
- Open a .java file to start this extension
- (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.
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.
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
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?
This is happening to me as well.
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" }
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.
Me too.. I've tried most of the things listed on the Internet and none of them seems to solve this problem.
@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
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.
@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.
@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.
Please delete ~/${APP_DATA}/workspaceStorage/, so you get clean logs
Alright. Will do that and let you know.
Is there any update regarding this issue ? I am experiencing exactly the same thing.
@ofir-popowski can you attach the vscode-java and server logs?
@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)
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?
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)
@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
@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:
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.
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>/
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.
The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.
java version "1.8.0_152" Java(TM) SE Runtime Environment (build 1.8.0_152-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
Version: 1.36.1 Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529 Date: 2019-07-08T22:55:08.091Z Electron: 4.2.5 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Linux x64 4.8.0-53-generic
What to do?
@guilhermefelipesilva please see https://github.com/redhat-developer/vscode-java/issues/112#issuecomment-508757427 Your logs are in ~/.vscode/extensions/redhat.java-*/server/config_linux/
@snjeza it's my file:
HOME/.vscode/extensions/redhat.java-0.47.0/server/config_linux/config.ini
#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser #Thu Jul 18 12:42:21 EDT 2019 osgi.bundles=reference\:file\:com.google.gson_2.8.2.v20180104-1110.jar@4,reference\:file\:com.google.guava_21.0.0.v20170206-1425.jar@4,reference\:file\:com.google.guava_27.1.0.v20190517-1946.jar@4,reference\:file\:com.ibm.icu.base_58.2.0.v20170418-1837.jar@4,reference\:file\:javax.inject_1.0.0.v20091030.jar@4,reference\:file\:javax.xml_1.3.4.v201005080400.jar@4,reference\:file\:org.apache.ant_1.10.5.v20190526-1402/@4,reference\:file\:org.apache.commons.lang3_3.1.0.v201403281430.jar@4,reference\:file\:org.apache.log4j_1.2.15.v201012070815.jar@4,reference\:file\:org.eclipse.ant.core_3.5.500.v20190701-1953.jar@4,reference\:file\:org.eclipse.buildship.core_3.1.0.v20190501-0830.jar@4,reference\:file\:org.eclipse.compare.core_3.6.600.v20190615-1517.jar@4,reference\:file\:org.eclipse.core.commands_3.9.500.v20190624-2109.jar@4,reference\:file\:org.eclipse.core.contenttype_3.7.400.v20190624-1144.jar@4,reference\:file\:org.eclipse.core.expressions_3.6.500.v20190617-1926.jar@4,reference\:file\:org.eclipse.core.filebuffers_3.6.700.v20190614-0928.jar@4,reference\:file\:org.eclipse.core.filesystem_1.7.500.v20190620-1312.jar@4,reference\:file\:org.eclipse.core.jobs_3.10.500.v20190620-1426.jar@4,reference\:file\:org.eclipse.core.net_1.3.600.v20190619-1613.jar@4,reference\:file\:org.eclipse.core.net.linux.x86_64_1.2.300.v20181130-0925.jar@4,reference\:file\:org.eclipse.core.resources_3.13.500.v20190624-0953.jar@4,reference\:file\:org.eclipse.core.runtime_3.15.400.v20190627-1301.jar@4\:start,reference\:file\:org.eclipse.core.variables_3.4.600.v20190614-1239.jar@4,reference\:file\:org.eclipse.debug.core_3.14.0.v20190705-1530.jar@4,reference\:file\:org.eclipse.equinox.app_1.4.300.v20190714-1849.jar@4,reference\:file\:org.eclipse.equinox.common_3.10.500.v20190714-1849.jar@4,reference\:file\:org.eclipse.equinox.frameworkadmin_2.1.300.v20190318-1320.jar@4,reference\:file\:org.eclipse.equinox.frameworkadmin.equinox_1.1.100.v20180822-1258.jar@4,reference\:file\:org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar@4,reference\:file\:org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190715-0945/@4,reference\:file\:org.eclipse.equinox.preferences_3.7.500.v20190714-1850.jar@4,reference\:file\:org.eclipse.equinox.registry_3.8.500.v20190714-1850.jar@4,reference\:file\:org.eclipse.equinox.security_1.3.300.v20190714-1851.jar@4,reference\:file\:org.eclipse.equinox.security.linux.x86_64_1.1.200.v20181106-0957/@4,reference\:file\:org.eclipse.equinox.simpleconfigurator_1.3.300.v20190716-0825.jar@4,reference\:file\:org.eclipse.equinox.simpleconfigurator.manipulator_2.1.300.v20190716-0825.jar@4,reference\:file\:org.eclipse.jdt.apt.core_3.6.500.v20190703-0914.jar@4,reference\:file\:org.eclipse.jdt.apt.pluggable.core_1.2.400.v20190626-1334.jar@4,reference\:file\:org.eclipse.jdt.compiler.apt_1.3.700.v20190704-1731.jar@4,reference\:file\:org.eclipse.jdt.compiler.tool_1.2.600.v20190322-0450.jar@4,reference\:file\:org.eclipse.jdt.core_3.19.0.v20190713-1602.jar@4,reference\:file\:org.eclipse.jdt.core.manipulation_1.12.100.v20190717-1950.jar@4,reference\:file\:org.eclipse.jdt.debug_3.13.100.v20190625-0415/@4,reference\:file\:org.eclipse.jdt.junit.core_3.10.400.v20190625-1910.jar@4,reference\:file\:org.eclipse.jdt.junit.runtime_3.4.1000.v20190510-0840.jar@4,reference\:file\:org.eclipse.jdt.launching_3.15.0.v20190708-0627.jar@4,reference\:file\:org.eclipse.jdt.ls.core_0.41.0.201907181636.jar@4\:start,reference\:file\:org.eclipse.lsp4j_0.8.0.v20190703-1324.jar@4,reference\:file\:org.eclipse.lsp4j.jsonrpc_0.8.0.v20190703-1324.jar@4,reference\:file\:org.eclipse.ltk.core.refactoring_3.10.200.v20190625-1910.jar@4,reference\:file\:org.eclipse.m2e.archetype.common_1.13.0.20190716-1623/@4,reference\:file\:org.eclipse.m2e.core_1.13.0.20190716-1624.jar@4,reference\:file\:org.eclipse.m2e.jdt_1.13.0.20190716-1624.jar@4,reference\:file\:org.eclipse.m2e.lifecyclemapping.defaults_1.13.0.20190716-1624.jar@4,reference\:file\:org.eclipse.m2e.maven.indexer_1.13.0.20190716-1623/@4,reference\:file\:org.eclipse.m2e.maven.runtime_1.13.0.20190716-1623/@4,reference\:file\:org.eclipse.m2e.maven.runtime.slf4j.simple_1.13.0.20190716-1623/@4,reference\:file\:org.eclipse.m2e.workspace.cli_0.3.1.jar@4,reference\:file\:org.eclipse.osgi.services_3.8.0.v20190206-2147.jar@4,reference\:file\:org.eclipse.osgi.util_3.5.300.v20190708-1141.jar@4,reference\:file\:org.eclipse.text_3.8.300.v20190618-0916.jar@4,reference\:file\:org.eclipse.xtend.lib_2.18.0.v20190528-0016.jar@4,reference\:file\:org.eclipse.xtend.lib.macro_2.18.0.v20190528-0016.jar@4,reference\:file\:org.eclipse.xtext.xbase.lib_2.18.0.v20190528-0016.jar@4,reference\:file\:org.gradle.toolingapi_5.4.0.v20190501-0832.jar@4,reference\:file\:org.hamcrest.core_1.3.0.v20180420-1519.jar@4,reference\:file\:org.jboss.tools.maven.apt.core_1.5.2.201812241535.jar@4,reference\:file\:org.junit_4.12.0.v201504281640/@4,reference\:file\:org.slf4j.api_1.7.2.v20121108-1250.jar@4 eclipse.application=org.eclipse.jdt.ls.core.id1 osgi.bundles.defaultStartLevel=4 osgi.framework=file\:plugins/org.eclipse.osgi_3.15.0.v20190715-1310.jar eclipse.product=org.eclipse.jdt.ls.core.product osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.1.600.v20190715-1310.jar [email protected]/../p2 eclipse.p2.profile=DefaultProfile
Is there a *.log file in the HOME/.vscode/extensions/redhat.java-0.47.0/server/config_linux directory?
Is there a *.log file in the HOME/.vscode/extensions/redhat.java-0.47.0/server/config_linux directory?
@snjeza there is no *.log file

I could find these logs in file /home/guilherme/.config/Code/logs/20190731T202429/exthost1/output_logging_20190731T202432:
[Info - 8:24:32 PM] Connection to server got closed. Server will restart. Error opening zip file or JAR manifest missing : /home/guilherme/.vscode/extensions/gabrielbb.vscode-lombok-0.9.8/server/lombok.jar Error opening zip file or JAR manifest missing : /home/guilherme/.vscode/extensions/gabrielbb.vscode-lombok-0.9.8/server/lombok.jar [Info - 8:24:33 PM] Connection to server got closed. Server will restart. Error opening zip file or JAR manifest missing : /home/guilherme/.vscode/extensions/gabrielbb.vscode-lombok-0.9.8/server/lombok.jar [Info - 8:24:33 PM] Connection to server got closed. Server will restart. Error opening zip file or JAR manifest missing : /home/guilherme/.vscode/extensions/gabrielbb.vscode-lombok-0.9.8/server/lombok.jar [Info - 8:24:33 PM] Connection to server got closed. Server will restart. Error opening zip file or JAR manifest missing : /home/guilherme/.vscode/extensions/gabrielbb.vscode-lombok-0.9.8/server/lombok.jar [Error - 8:24:33 PM] Connection to server got closed. Server will not be restarted.
