Skip to content

[validation] exception thrown while validating spring boot versions #1144

Closed

Description

@martinlippert

I came across this exception showing up in the log output of the language server:

2023-11-08T15:26:08.628+01:00 ERROR 87055 --- [ct-Reconciler-1] o.s.i.v.b.v.BootVersionValidationEngine  : Failed validating Spring Project version

java.lang.Exception: Unable to find build file in project while computing version validation for: spring-petclinic
	at org.springframework.ide.vscode.boot.validation.generations.ProjectVersionDiagnosticProvider.getDiagnostics(ProjectVersionDiagnosticProvider.java:43) ~[classes/:na]
	at org.springframework.ide.vscode.boot.validation.BootVersionValidationEngine.reconcile(BootVersionValidationEngine.java:50) ~[classes/:na]
	at org.springframework.ide.vscode.boot.common.ProjectReconcileScheduler.lambda$3(ProjectReconcileScheduler.java:85) ~[classes/:na]
	at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[na:na]
	at org.springframework.ide.vscode.boot.common.ProjectReconcileScheduler.lambda$2(ProjectReconcileScheduler.java:83) ~[classes/:na]
	at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:171) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run(MonoPublishOn.java:181) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.5.11.jar:3.5.11]
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.5.11.jar:3.5.11]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

It showed up while starting things up in VSCode and the same exception was thrown for all three projects that I had in the workspace. No idea how to reproduce this though, but I hope the exception itself can give us a hit what to do about this.

Activity

  1. added
    for: eclipse
    for: vscode
    on Nov 9, 2023
  2. added this to the 4.21.0.RELEASE milestone on Nov 9, 2023
  3. martinlippert commented on Nov 9, 2023

    @martinlippert
    MemberAuthor

    The projects definitely have build files included, like pom.xml

  4. BoykoAlex commented on Nov 28, 2023

    @BoykoAlex
    Contributor

    Exception -> Warning in the log with 7210c50

  5. martinlippert commented on Nov 29, 2023

    @martinlippert
    MemberAuthor

    Ok, I think I found a way to reproduce this issue, using the latest VSCode + the Spring Tools switched to pre-release.

    1. start with a clean empty window in VSCode
    2. On the welcome screen, click on More... at the bottom of the walkthrough section
    3. select the getting started with spring item from the quick pick list appearing on the command palette
    4. click the "open sample project" button from the first step of the walkthrough
    5. select a new empty folder for the project
    6. select to open the project in the current empty workspace
    7. there are various popups appearing, most of them can be canceled - but there is one asking for which build tool to use: select "Gradle"
    8. wait for the project to be build, open a java source, look in the outline view for spring symbols to appear
    9. spring-specific problems appear in the problems view (two, I think)
    10. open the log output of the spring language server (this needs to be configured in the preferences upfront, so that the spring boot language server puts everything into a file)

    The above mentioned exception will appear in the log.

    I have the Gradle extension from Microsoft installed as well and selected the Gradle Build Server approach to be used in the preferences, in case this makes a difference (Preferences -> Extensions -> Gradle -> Build Server:enabled)

  6. BoykoAlex commented on Nov 29, 2023

    @BoykoAlex
    Contributor

    @martinlippert thanks very much for the steps. Seems like the key part of this the Gradle extension from MS as it doesn't seem to create the container classpath entry to keep dependencies which Buildship or M2E creates. I've added a somewaht naive logic to determine Maven vs Gradle project for the case of the missing container CPE: 9478964. Seems to work.

  7. removed
    for: eclipse
    on Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: vscodetheme: validationtype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions