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

Development mode not working due to long classpath. #21051

Open
wubwubwub opened this issue Feb 26, 2025 · 2 comments
Open

Development mode not working due to long classpath. #21051

wubwubwub opened this issue Feb 26, 2025 · 2 comments

Comments

@wubwubwub
Copy link

wubwubwub commented Feb 26, 2025

Description of the bug

I have seen similar issues being discussed as early as 2018 but hear me out, I have a simple (essentially an empty sample Flow based project, generated by intellij vaadin plugin template (gradle based). And once I add 2 more dependencies, whole dev mode breaks - vital flow dev mode scripts and resources are not present on the page. Again, this is vanilla 'hello world' project. By comparing broken vs working logs, this line stands out:

[ main] c.v.f.s.f.s.FullDependenciesScanner : Visited 2 classes. Took 11 ms.

when things are working it would say Visited 89 classes or so.
After spending 2 more days in debugger, I found out that this break is triggered by path shortening mechanism used by bootRun task in gradle and also if you try and run using intellij with path shortening. The thing is, vaadin relies on spring boot package scanning which at some point calls org.springframework.core.io.support.PathMatchingResourcePatternResolver#getClassPathManifestEntriesFromJar which can't handle absolute path names in jars manifest. This is actually congruent with how JRE itself treats manifest classpath (relative by design). However gradle bootRun and intellij direct 'application' run both have to use absolute paths in classpath jar manifest. I am not sure how spring boot community lives with this bug, but for vaadin on windows, this is complete deal breaker due to humongous amount of dependencies for vaadin dev mode.

Expected behavior

The sample application should load fully. Developer tools and vaadin button should be present in development mode.

Minimal reproducible example

Using intellij (latest version, as described in versions) with vaadin plugin installed, generate Flow based, Gradle based starter project.
open build.gradle and add 1-5 more dependencies (transitive dependencies matter). For me, this single dependency did the trick (add maven { setUrl("https://repo.spring.io/snapshot") } repo)

 implementation("org.springframework.ai:spring-ai-core:1.0.0-SNAPSHOT") 

load the sample page. you will see majority of it is not rendered, vaadin tools button / control is absent.

Versions

  • Vaadin / Flow version: 24.6.5
  • Java version: 21
  • OS version: Windows 10
  • Browser version (if applicable): Chrome 133.0.6943.127
  • Application Server (if applicable): Spring boot 3.2.1
  • IDE (if applicable): Intellij CE 24.3.3
@Artur-
Copy link
Member

Artur- commented Feb 26, 2025

Sounds pretty bad. As you did not provide a reproducible project I tried to create one here based on the given instructions: https://github.com/Artur-/test-gradle-long-classpath

When running the project on mac os, there are no issues.
When running the project on Windows 11 (through parallels on mac), there are no issues.

What is missing?

@mcollovati
Copy link
Collaborator

Application Server (if applicable): Spring boot 3.2.1

Probably not related to the issue, but Vaadin 24.6 supports Spring Boot 3.4 or newer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔎 Investigation
Development

No branches or pull requests

4 participants