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

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

Closed
martinlippert opened this issue Nov 9, 2023 · 4 comments
Closed
Assignees
Labels
for: vscode something that is specific for VSCode theme: validation type: bug

Comments

@martinlippert
Copy link
Member

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.

@martinlippert martinlippert added type: bug status: needs-investigation for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation labels Nov 9, 2023
@martinlippert martinlippert added this to the 4.21.0.RELEASE milestone Nov 9, 2023
@martinlippert
Copy link
Member Author

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

@BoykoAlex
Copy link
Contributor

Exception -> Warning in the log with 7210c50

@martinlippert
Copy link
Member Author

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)

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

@martinlippert martinlippert removed status: needs-investigation for: eclipse something that is specific for Eclipse labels Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: vscode something that is specific for VSCode theme: validation type: bug
Projects
None yet
Development

No branches or pull requests

2 participants