Repository navigation
Description
Hi,
I just wanted to try out the new STS4 beta version with a simple Spring Boot Demo project. But when starting Eclipse STS4 I always get the following error in the Eclipse Error Log:
LanguageServer not initialized after 10s
with the following stack trace:
java.util.concurrent.TimeoutException
at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1771)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at org.eclipse.lsp4e.LanguageServerWrapper.getServerCapabilities(LanguageServerWrapper.java:488)
at org.eclipse.lsp4e.LanguageServiceAccessor.getLSWrappers(LanguageServiceAccessor.java:243)
at org.eclipse.lsp4e.LanguageServiceAccessor.getLSPDocumentInfosFor(LanguageServiceAccessor.java:354)
at org.eclipse.lsp4e.ConnectDocumentToLanguageServerSetupParticipant$1.run(ConnectDocumentToLanguageServerSetupParticipant.java:74)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
And in the progress window the "Initialize Language Servers for DemoApplication.java" task hangs forever.
For installation I downloaded the "Spring Tools 4 for Eclipse" distribution and created an empty workspace without any additional customization:
Spring Tool Suite 4
Version: 4.0.0.M6
Build Id: 201711271125
My Eclipse is started with :
java.version=1.8.0_121
java.home=D:<JDK_HOME>\jre
If I understand it correctly Eclipse should start the Spring Boot Language Server but I guess this somehow fails. But I have no idea why or where I should look for further information. In the Eclipse workspace log I only see these log messages:
!ENTRY org.eclipse.ui 2 0 2017-12-11 12:52:33.022
!MESSAGE Warnings while parsing the images from the 'org.eclipse.ui.commandImages' extension point.
!SUBENTRY 1 org.eclipse.ui 2 0 2017-12-11 12:52:33.022
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.lsp4e', id='org.eclipse.lsp4e.togglehighlight'
!ENTRY org.eclipse.jface 2 0 2017-12-11 12:52:34.116
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2017-12-11 12:52:34.116
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
Open a type in a Java editor,
Category(org.eclipse.ui.category.navigate,Navigate,null,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@a7ae340,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
,
Category(org.eclipse.lsp4e.category,Language Servers,null,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5e8bd498,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!ENTRY org.eclipse.lsp4e 4 0 2017-12-11 12:52:48.050
!MESSAGE LanguageServer not initialized after 10s
!STACK 0
java.util.concurrent.TimeoutException
at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1771)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at org.eclipse.lsp4e.LanguageServerWrapper.getServerCapabilities(LanguageServerWrapper.java:488)
at org.eclipse.lsp4e.LanguageServiceAccessor.getLSWrappers(LanguageServiceAccessor.java:243)
at org.eclipse.lsp4e.LanguageServiceAccessor.getLSPDocumentInfosFor(LanguageServiceAccessor.java:354)
at org.eclipse.lsp4e.ConnectDocumentToLanguageServerSetupParticipant$1.run(ConnectDocumentToLanguageServerSetupParticipant.java:74)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Any help is highly appreciated. The new "Runtime information in your editor" features looks really cool and I can't wait to try it out on my machine :-)
Thanks and regards,
Andreas
Activity
kdvolder commentedon Dec 11, 2017
Your guess that the Eclipse (lsp4e component) is having troubles starting the language server seems about right. But unfortunately I also don't have much of an idea why. It could be related to the JVM setup. Maybe language server start can't find the JVM somehow. Also I think we need a JDK not a JRE.
You may be one of the first people to try it on a Windows box, (all of us are on Mac or Linux) so it could be it simply doesn't work on Windows. I'll try it later on a Windows VM setup and see if it works for me.
About the only suggestion I have for now, make sure your Java setup is a JDK not a JRE. But its a bit of a wild guess only.
kdvolder commentedon Dec 11, 2017
Good news... (or bad, depending on how you look at it :-). I tried STS4 on my windows VM and it doesn't work. Getting very similar problems to what @brunpoern describes. Of course its bad we are having problems running on Windows, but its good that I can reproduce the problem, so I can try to debug it now.
[-]LanguageServer not initialized after 10s[/-][+]On Windows: LanguageServer not initialized after 10s[/+]kdvolder commentedon Dec 12, 2017
I've pushed some fixes. I'll do some more testing tomorrow on windows. I did get the boot-java support to work properly on windows. But didn't have much time to test it yet.
brunpoern commentedon Dec 12, 2017
I just installed the latest nightly build and it seems to work. Awesome. Thank you very much for the fast response.
brunpoern commentedon Dec 12, 2017
I now tried to use the Language Server feature with a more complex example. The example project is part of a bigger Gradle multi-project build and in the Eclipse workspace there are also some unused pom.xml files (we migrated to Gradle recently). If I start Eclipse I get Spring Boot Java Language Server Error "Cannot load Gradle project model from folder: ...". Sometimes I also get the error "Cannot load Maven project model ..." where it picks a (random?) pom.xml file from my Eclipse workspace. I'm wondering what STS4/Language Server expects here. Does it really try to load my build files? The Eclipse projects itself doen't have any Maven/Gradle nature. We just generate Eclipse project files from Gradle and import them as normal Java Projects. Does STS4 require to have Gradle/Maven Eclipse projects or should it also work with "plain" Java projects?
In the Eclipse workspace log I get the following error but I'm not sure if it's related:
Should I create a new issue for this problem?
Thanks and regards,
Andreas
BoykoAlex commentedon Dec 12, 2017
No it doesn't require Eclipse projects... Which Gradle version is being used by your project?
There is a limitation in the STS4 tooling related to Gradle projects at the moment (due to a bug in Gradle which was fixed for the latest Gradle version leaving us with limitations for older versions). Any chance you can point us to a git repo with your Gradle project(s) to try?
I'd say it's a separate issue. Unlikely to be Win specific.
brunpoern commentedon Dec 12, 2017
I created a new issue for the Gradle/Maven problem.
martinlippert commentedon Dec 12, 2017
@brunpoern
Does that mean we can close this issue already as fixed or is anything still open here?
kdvolder commentedon Dec 12, 2017
Having both gradle and maven build files will confuse the tooling. I can't predict right now what will happen if you do that (nor do I know what would be a good way to handle it since I don't see how the tooling could guess which one you really wanted to use). I don't think it will pick randomly, the result will be deterministic, but I really wouldn't expect it to work.
brunpoern commentedon Dec 12, 2017
@martinlippert
From my point of view this issue can be closed. It works for me with a simple Maven demo project. And again, the runtime information view is really cool :-)
@kdvolder
Please forget the mixture of Gradle and Maven build files. I guess it was a bit confusing. And I deleted the pom.xml files in the meantime :-) So now we have only Gradle build files. But as explained in the new issue, we don't import them directly in Eclipse.
anumalasri commentedon Jan 9, 2018
After updating Latest Nightly Build (Spring Tool Suite 4 Version: 4.0.0.CI-B803 Build Id: 201801051108),
the below error still coming in logs and STS4 got frozen during that time...
Some times, it will be back in few seconds and some times, it won't be back.
Just wonder, Any option available to skip LSP in STS4 ?
BoykoAlex commentedon Jan 9, 2018
It's likely you have a rogue LS process running on your system Close STS4, shut down boot apps if there are any running. Run
jpscommand in the console and see if you have anyJarLauncherprocesses. If yes, these are theboot-javalanguage servers process. Kill them then restart STS - ideally that should do it.If you wish to turn off LSP support in STS4 completely you'd have to uninstall the Spring Boot Java feature from STS... (from
About Spring Tool Suite->Installation Detailsetc.)anumalasri commentedon Jan 9, 2018
Thanks for your quick response. Yes, there are two processes running each for JarLauncher and boot-properties-language-server-0.1.3-SNAPSHOT.jar.
I will try to kill those processes and see.
I believe, these processed triggered from STS4. Would not they be closed when STS4 get closed (gracefully) ?
BoykoAlex commentedon Jan 9, 2018
They should be shut down when STS is closed. Were you trying to run VSCode or Atom with
boot-javaorboot-propertiesextensions?Were you always exiting gracefully from STS?