You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[refactoring] converting a simple rest service guide to Spring Boot 3 fails #867
Converting a standard Rest Service guide to Spring Boot 3 using the OpenRewrite recipes fails with:
(1) an exception:
java.lang.reflect.InvocationTargetException
at org.springframework.tooling.boot.ls.commands.RewriteRefactoringsHandler.lambda$10(RewriteRefactoringsHandler.java:133)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at org.springframework.tooling.boot.ls.commands.RewriteRefactoringsHandler.lambda$10(RewriteRefactoringsHandler.java:130)
... 1 more
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$3(LanguageServerWrapper.java:286)
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:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
The language server output doesn't show anything, no exception and no other error message related to this.
(2) the conversion is not complete, the Spring Boot version is not upgraded (probably due to a missing maven repo for milestones/snapshots)
Yes, I noticed this briefly while upgrading petclinic to 3.0. Thought about giving 4.16.1 a -1 because of this but then I stopped seeing this error and no else from those testing the build complained. If I can reproduce this reliably with Rest Service Guide I'd be happy to get to the bottom of this.
@martinlippert did you have POM file opened while upgrading? If yes, switch off XML Language Server and try again I suspect that the errors might go away... Also before bringing up the rewrite recipes selector dialog project contents need to be saved - I'll address this.
It looks like the command to execute the rewrite recipes is being sent to the XML language server:
[t=1668968235481] LSP4E to org.eclipse.wildwebdeveloper.xml:
{"jsonrpc":"2.0","id":"10","method":"workspace/executeCommand","params":{"command":"sts/rewrite/execute","arguments":...
In addition that it looks to me like the message that is being sent to the language server to execute the command is extremely long (more than 500k (!)). So it looks like we need to investigate why this message is being sent to the XML language server and why this message is so long.
Instead i plan to use LanguageServerRegistry to find the LS definition for id and then find the exact language server wrapper with the help of LanguageServerWrapper getLSWrapper(IProject project, LanguageServerDefinition serverDefinition) find the exact boot ls wrapper and if it's active execute the command on just that language server.
The long message issue... this is due to me sending recipe descriptors for the selected recipes... Recipe descriptor is ane exact data required to create a recipe on the server side, i.e description, name, parameters. Although i think 500Kb is a bit too much even for this data...
I limited command execution only to Boot LS with this: dd2f60a
If 500Kb JSON parameter for the command can go to a separate issue (seems lower priority) then we try closing this one
Activity
BoykoAlex commentedon Nov 4, 2022
Yes, I noticed this briefly while upgrading petclinic to 3.0. Thought about giving 4.16.1 a -1 because of this but then I stopped seeing this error and no else from those testing the build complained. If I can reproduce this reliably with Rest Service Guide I'd be happy to get to the bottom of this.
BoykoAlex commentedon Nov 7, 2022
@martinlippert did you have POM file opened while upgrading? If yes, switch off XML Language Server and try again I suspect that the errors might go away... Also before bringing up the rewrite recipes selector dialog project contents need to be saved - I'll address this.
martinlippert commentedon Nov 10, 2022
Yes, that indeed makes the error go away, but I am wondering what exactly triggers this error. Will look more into this, I guess.
martinlippert commentedon Nov 20, 2022
This seems to be the error message that causes the exception:
It looks like the command to execute the rewrite recipes is being sent to the XML language server:
martinlippert commentedon Nov 20, 2022
In addition that it looks to me like the message that is being sent to the language server to execute the command is extremely long (more than 500k (!)). So it looks like we need to investigate why this message is being sent to the XML language server and why this message is so long.
BoykoAlex commentedon Nov 21, 2022
@martinlippert good finds... I think I understand why the command goes out to XML LS when pom is opened. I think it is because of this:
Instead i plan to use
LanguageServerRegistryto find the LS definition for id and then find the exact language server wrapper with the help ofLanguageServerWrapper getLSWrapper(IProject project, LanguageServerDefinition serverDefinition)find the exact boot ls wrapper and if it's active execute the command on just that language server.The long message issue... this is due to me sending recipe descriptors for the selected recipes... Recipe descriptor is ane exact data required to create a recipe on the server side, i.e description, name, parameters. Although i think 500Kb is a bit too much even for this data...
BoykoAlex commentedon Nov 21, 2022
I limited command execution only to Boot LS with this: dd2f60a
If 500Kb JSON parameter for the command can go to a separate issue (seems lower priority) then we try closing this one
martinlippert commentedon Nov 21, 2022
I created a new issue for the message size issue: #897
martinlippert commentedon Nov 21, 2022
Tested this with the latest nightly build, looks great. Closing this one as fixed.