Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrading from Spring Boot 3.0.x to 3.1.0 doesn't work #1051

Closed
martinlippert opened this issue Jun 5, 2023 · 4 comments
Closed

upgrading from Spring Boot 3.0.x to 3.1.0 doesn't work #1051

martinlippert opened this issue Jun 5, 2023 · 4 comments
Assignees

Comments

@martinlippert
Copy link
Member

Upgrading a Spring Boot 3.0.x project to Spring Boot 3.1.0 using the quick fix for the "new minor version available" information marker doesn't work (does nothing on the UI), but throws an internal exception.

Two important pieces that I have in mind here:

  1. we should investigate and fix the underlying issue
  2. we should make sure that if something goes wrong while updating the project, a message shows up on the UI

Steps to reproduce:

  • create Rest Service sample app
  • manually edit pom.xml file and switch the parent version to 3.0.7
  • select the quick fix from the information marker to upgrade to Spring Boot 3.0 (this quick fix is really irritating, added some details at the end of this description)

The following exception occurs:

12:48:26.583 [pool-11-thread-1] ERROR o.e.lsp4j.jsonrpc.RemoteEndpoint - Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.springframework.ide.vscode.commons.languageserver.util.ParentProcessWatcher.lambda$apply$0(ParentProcessWatcher.java:129)
	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)
Caused by: java.lang.reflect.InvocationTargetException: null
	at jdk.internal.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 12 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot upgrade Spring Boot Project 'gs-rest-service-complete' because its version '3.0' is newer or same as the target version '3.0'
	at org.springframework.ide.vscode.commons.util.Assert.isLegal(Assert.java:32)
	at org.springframework.ide.vscode.boot.java.rewrite.SpringBootUpgrade.lambda$new$1(SpringBootUpgrade.java:70)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer.executeCommand(SimpleLanguageServer.java:276)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleWorkspaceService.executeCommand(SimpleWorkspaceService.java:145)
	... 16 common frames omitted
12:48:42.427 [pool-11-thread-1] ERROR o.e.lsp4j.jsonrpc.RemoteEndpoint - Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.springframework.ide.vscode.commons.languageserver.util.ParentProcessWatcher.lambda$apply$0(ParentProcessWatcher.java:129)
	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)
Caused by: java.lang.reflect.InvocationTargetException: null
	at jdk.internal.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 12 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot upgrade Spring Boot Project 'gs-rest-service-complete' because its version '3.0' is newer or same as the target version '3.0'
	at org.springframework.ide.vscode.commons.util.Assert.isLegal(Assert.java:32)
	at org.springframework.ide.vscode.boot.java.rewrite.SpringBootUpgrade.lambda$new$1(SpringBootUpgrade.java:70)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer.executeCommand(SimpleLanguageServer.java:276)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleWorkspaceService.executeCommand(SimpleWorkspaceService.java:145)
	... 16 common frames omitted

Another problem of this is, that the quick fix sounds like you should upgrade to Spring Boot 3.0, even though the project is already on Spring Boot 3.0.7 and you would like to upgrade to Spring Boot 3.1. So we need to fix that part as well.

@martinlippert martinlippert added this to the 4.19.0.RELEASE milestone Jun 5, 2023
@martinlippert martinlippert changed the title upgrading from Spring Boot 3.0.x to 3.1.0doesn't work upgrading from Spring Boot 3.0.x to 3.1.0 doesn't work Jun 5, 2023
@BoykoAlex
Copy link
Contributor

The error dialog should popup from lsp4e... we don't have control over it. Will look into surfacing the error in the lsp4e once removed API changes are fully adopted.

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Jun 5, 2023

There is no 3.1.0 upgrade available yet in rewrite. There a short recipe for properties upgrade but nothing more. Lets keep it opened for now. If nothing shows up for the 3.1.0 upgrade then I'll create a PR for the pom upgrade part for rewrite-spring. Otherwise I've pushed this in so far b59b612

@BoykoAlex
Copy link
Contributor

Boot 3.1 Upgrade PR: openrewrite/rewrite-spring#368
Error reporting PR: eclipse/lsp4e#685

@BoykoAlex
Copy link
Contributor

PRs merged also this pushed: e0c9f9f. Should be all fixed noew

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

No branches or pull requests

2 participants