Skip to content

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

Closed

Description

@martinlippert

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.

Activity

  1. added this to the 4.19.0.RELEASE milestone on Jun 5, 2023
  2. changed the title [-]upgrading from Spring Boot `3.0.x` to `3.1.0`doesn't work[/-] [+]upgrading from Spring Boot `3.0.x` to `3.1.0` doesn't work[/+] on Jun 5, 2023
  3. BoykoAlex commented on Jun 5, 2023

    @BoykoAlex
    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.

  4. BoykoAlex commented on Jun 5, 2023

    @BoykoAlex
    Contributor

    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

  5. BoykoAlex commented on Jun 6, 2023

    @BoykoAlex
    Contributor

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

  6. BoykoAlex commented on Jun 6, 2023

    @BoykoAlex
    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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions