Repository navigation
Description
I recently upgraded to Eclipse 2019-12 with everything else.
Today I notice completion proposals being sluggish and constantly having as first "proposal"
Error while computing completion
$WORKSPACE/.metadata/.log/
shows the following:
!ENTRY org.eclipse.lsp4e 4 0 2020-01-21 15:20:06.279
!MESSAGE org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
!STACK 0
java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at org.eclipse.lsp4e.operations.completion.LSContentAssistProcessor.computeCompletionProposals(LSContentAssistProcessor.java:96)
at org.springframework.tooling.boot.ls.jdt.SpringBootJavaCompletionProposalComputer.lambda$0(SpringBootJavaCompletionProposalComputer.java:55)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
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)
Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
at org.eclipse.lsp4e.LanguageServerWrapper.lambda$1(LanguageServerWrapper.java:244)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Eclipse IDE for Enterprise Java Developers.
Version: 2019-12 (4.14.0)
Build id: 20191212-1212
Spring Boot Language Server Feature 4.5.0.201912170939 org.springframework.tooling.boot.ls.feature.feature.group Pivotal, Inc.
Spring IDE Boot Microservices Dash 3.9.11.201912160804-RELEASE org.springframework.ide.eclipse.boot.dash.feature.feature.group Spring IDE Developers
Spring Tool Suite 4 Main Feature 4.5.0.201912171052-RELEASE org.springframework.boot.ide.main.feature.feature.group Pivotal, Inc.
Spring XML Namespace Support 3.9.11.201912160804-RELEASE org.springframework.ide.eclipse.xml.namespaces.feature.feature.group Pivotal, Inc.
Activity
BoykoAlex commentedon Jan 21, 2020
Looks like there is an error occurring on the Language Server process... what you've pasted above (the eclipse log) is the consequence of the error on the language server side.
Please go to Preferences -> Language Servers -> Spring Language Servers preference page and check-mark Spring Boot.
Either restart STS now or Close all editors and then open a Java file and invoke content assist.
One of the consoles in the Console view labeled Spring Boot Language Server n should have the log of the language server. Please copy paste the language server log here for us.
Besides the above ensure you're on the latest STS4 tooling in your Eclipse. Did you upgrade STS4 from this site: https://download.springsource.com/release/TOOLS/sts4/update/e4.14/ ?
2019-05-10 commentedon Jan 22, 2020
How do I restart STS manually?
I have both
https://download.springsource.com/release/TOOLS/sts4/update/e4.14
and
https://download.springsource.com/release/TOOLS/sts4/update/latest
enabled as update sites.
Edit:
BTW, it is not even a Spring/SpringBoot project, just plain Java/Maven.
2019-05-10 commentedon Jan 22, 2020
Since it took a rather long time for the issue tom occur again, the log
a) is huge (~ 1000 lines)
b) contains info about several projects and my system, which I am not willing to share (apparently SpringProcessConnectorService tries to connect to everything java? And other parts of STS read projects that have no relation to STS at all? Seems rather intrusive.).
Here the most stacktrace
Let me know what else you may need so I can trim down the log file accordingly.
BoykoAlex commentedon Jan 22, 2020
The log on the language server side seems to indicate that some text document got out of sync between language server process and eclipse... the language server somehow ended up with out-of-date version of the editor contents... The log doesn't reveal the reason for the above...
Close all editors in STS. Try to open only files for the non-Spring Java project you work with. The Spring Boot Language Server would start for it anyway. However, since it is not a Boot project CA should return 0 completions right away because java files from non-Spring projects aren't tracked by the language server. It'd be great to see when BadLocationException starts occurring...
Anyway to share your project with us? Or maybe try to reproduce it with simple Maven Java project?
Looks like it takes a while to reproduce the issue... Are there some specific steps for us to try to reproduce it on our end?
2019-05-10 commentedon Jan 24, 2020
Attached an anonymized log. Project I was working with is called "pdfbox-test".
Project has been created with Eclipse's "New project -> New Maven project" wizard, simple, no archetypes.
.project, classpath, .settings/*, pom.xml attached as well.
files.zip
The first "proposal"
Error while computing completion
doesn't appear anymore, but that's most likely due to the project not being a SpingBoot project -- nevertheless, the server runs and acts on every action. I don't think it should do that with non-springboot project.
Given the amount of time it took (yesterday and today!) to get even that log, it's not possible to create another project just for that.
As for steps ... since I don't even know what happens, I don't know what triggers that.
Seems to be related to time or activity. The more/longer the editor is worked on, the probability of the error seems to increase.
kdvolder commentedon Jan 24, 2020
I don't think there's really a way to avoid it. The lsp4e language server framework activates the language server based on type of file. So basically, if you want to provide functionality in .java files then the language server is activated for any .java file.
BoykoAlex commentedon Jan 29, 2020
@2019-05-10 The project is missing source folders and their content... I think when you export the project to archive you need to explicitly select folders to be included in the archive. We'd need the project with the source
2019-05-10 commentedon Feb 11, 2020
The code was left out intentionally.
Since it takes a long time for the error to occur, I cannot afford to spend time on coding just to trigger that error, but need to be productive. Hence, the code is work-related.
But it's plain Java based on
https://github.com/dhorions/boxable
and
https://pdfbox.apache.org/2.0/
kdvolder commentedon Feb 11, 2020
@2019-05-10 We understand. Unfortunately we also have to be productive and spending time on a typically futile effort to fix something we have no way of reproducing is not very productive. So this ticket will probably just remain sitting open without much progress / work on it until we stumble on the problem ourselves or someone else runs into it also and provide some way we can reproduce it.
kdvolder commentedon Feb 11, 2020
BTW: It sounds like a nasty problem for which a reliable method of reproduction will indeed be hard to provide. Even if you were to provide your work related code, I don't think it will necessary lead to being able to therefore reproduce this issue (as you say it typically takes a long time, and it is hard to guess at what specific action may have caused it). So I think we are a bit caught between the proverbial "rock and hard-place".
BoykoAlex commentedon Feb 11, 2020
@2019-05-10 Try attaching a VisualVM profiler snapshot for us :-)
See these instructions: #282 (comment)
martinlippert commentedon Feb 19, 2020
@2019-05-10 First of all, thank you very much for reporting this and spending time trying to help us to reproduce the issue. As we can see it is sometimes hard to reproduce such issues and sometimes difficult to find the root cause of those issues. Nevertheless, I would like to dig a bit deeper here to see how we can find that issue and solve it for the future. I also understand that you cannot spend a lot of time to create artificial random projects to reproduce the issue and it is even not clear if that is possible at all for this issue. Therefore I find the comment from Kris above about productivity a bit misleading and would like to apologize for that. We provide the tools that you (hopefully) like to use to be productive and I understand it as part of our work to make you productive - not the other way around.
With regards to the "intrusive" activation of the Spring Boot tooling for all Java projects, this is indeed true and partly caused by the underlying architecture. The Spring Boot language server (the one that provides most of the Spring related functionality) is build in an IDE-agnostic way. It gets invoked by the IDE without the IDE really knowing a lot about it. So it is registered for all source files of type "Java" (for example). The language server itself then decides whether to do anything with that file or not. We could insert some specific logic to determine whether it is a Spring project or not, but the question would remain where to use that logic (inside the IDE or the language server). Anyhow, don't want to bother you with too many details, just trying to explain why the language server is activated for all Java projects/files instead of only Spring-related ones.
The ultimate goal for us is definitely to make the language server as reliable and performant as possible, to that it doesn't really make a difference whether it is used for every Java project or not. Maybe we should re-think that, but it would also mean to multiply the numbers of different implementations for that logic, since it would reside on the IDE, which could be Eclipse, VSCode, Theia, or something else.
With regards to your concrete issue, you could disable the Spring Boot Language Server for Java files via the preferences for the Language Servers in your IDE. But that would also mean to loose a big part of the Spring Tools functionality. But maybe this is a good temporary workaround when you hit the issue.
In addition to that we should make sure that even if such a problem occurs, the IDE doesn't get sluggish. For that, the stack trace that you provided should already help. It doesn't really explain why the language server ended up in that place, but at least it should not turn the IDE sluggish in case that happens, but fail faster and more gracefully. I will add that to our issues to tackle.
If you observe anything special with regards to this issue or come across any further details and/or ideas that might be related, please comment. Your input is always welcome and appreciated.
martinlippert commentedon Apr 6, 2020
We identified a major issue with might be related to the observations in this issue item. Feel free to download the latest nightly CI build and give it a try: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html. Would be interesting to hear from you whether our fix improves the situation for you, too.
martinlippert commentedon Apr 30, 2020
We implemented a bunch of improvements to avoid any damage to the general Java editing experience, so I think this item can be closed now. Feel free to grab one of the latest nightly downloads to verify and report back. Would be great to hear your feedback from using those latest nightly builds: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html
The release containing these improvements is scheduled for late May.
martinlippert commentedon Jul 9, 2020
We also found a major issue that could cause the
BadLocationExceptionto be thrown on the language server side and fixed that. The fix will be part to the 4.7.1 release, scheduled for late July/early August.