Skip to content

Upgrade spring boot 3->4 and vaadin 24->25 - #1454

Merged
KochTobi merged 102 commits into
mainfrom
dependencies/upgrade-spring-boot
Aug 10, 2026
Merged

Upgrade spring boot 3->4 and vaadin 24->25 #1454
KochTobi merged 102 commits into
mainfrom
dependencies/upgrade-spring-boot

Conversation

@KochTobi

@KochTobi KochTobi commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

Upgrades the project to spring boot 4 and vaadin 25

Changes made

Vaadin upgrade to 25.2.5
Replaced or removed deprecated Vaadin functionality or features. Mainly regarding the Upload and Download of data. Requires upgrade of spring boot from 3 to 4 and introduces Jackson.

  1. Replaced deprecated StreamResource with DownloadHandler
  2. Replaced deprecated VaadinWebSecurity with security filter chain
  3. Migrated UploadWithDisplay to new UploadHandler API
  4. Removed deprecated getOboId() usage
  5. Removed deprecated findSample() method
  6. Added @AnonymousAllowed to DataManagerLayout and LandingPageLayout — Vaadin 25 enforces stricter access control where views with @AnonymousAllowed cannot be nested inside layouts without it, which was blocking unregistered users from accessing the registration flow, login, password reset, legal notice, and data privacy pages
  7. Uncommented loginForm.setAction("login") in LoginLayout — required for the LoginForm to POST credentials to Spring Security's form login endpoint. Without it, the form only fires a server-side LoginEvent that does not perform actual authentication

Spring boot upgrade to 4.1.0
Change of dependency naming (see spring migration guide). Upgrade dependencies where possible. Move from Jackson 2 to Jackson 3 and use the new namespace tools.jackson where applicable.

Jackson 3 Migration

  1. Changed Java package imports: com.fasterxml.jackson -> tools.jackson
  2. Updated Maven BOM references to Jackson 3
  3. Added explicit ObjectMapper bean for dependency injection as they are immutable now
  4. Removed @ReadingConverter annotation (absent in Spring Data with Jackson 3)
  5. Removed jackson-datatype-jsr310 as it is not needed in Jackson 3

Spring Security 7 Changes

  1. Added spring-boot-starter-oauth-client
  2. Fixed ClientRegistrationRepository bean creation
  3. Fixed OAuth2 login failures after Spring Boot 4 upgrade:
    • Replaced Jetty HTTP client with JDK client in OAuth2 token exchange (the openbis-api fat JAR bundles Jetty 9 classes, which are incompatible with Spring Framework 7's JettyClientHttpRequestFactory that expects Jetty 12 API)
    • Configured RestClient with required OAuth2 message converters (FormHttpMessageConverter, OAuth2AccessTokenResponseHttpMessageConverter) and error handler
    • Added explicit user-name-attribute=sub to ORCID provider configuration (Spring Security 7 no longer infers this default)
    • Added OAuth2 failure handler with proper logging — previously failures were silently swallowed with no server-side diagnostics
    • Login page now shows a distinct error message for OAuth2 failures instead of the misleading "Incorrect username or password"

Open issues

  • theme.json - Lumo imports removed from vaadin 25 by default
  • Collapsible sidebar always shown even if no content is added. Might be due to missing lumo variables
  • CSS minification does not accept delimiter > after pseudo element selectors e.g. a::before > *
  • CI is broken on the branch, needs fixing

KochTobi and others added 30 commits May 27, 2026 15:50
Disables code signing plugin. Needs to be re-enabled when migration is finished.
Replaces the VaadinWebSecurity as it is deprecated.
Replace deprecated Receiver/StreamResource pattern with UploadHandler
for Vaadin 24.8+ compatibility.
…tware/data-manager-app into dependencies/upgrade-spring-boot
Avoids Nullpointer
…aces

- UploadFileDisplay: single onFilesChanged(List) method with FileEntry record and ValidationStatus enum
- UploadContentValidator: validate(String fileName, InputStream) returning Optional<String>
- Pre-commit design: single method approach avoids race conditions; validator returns empty Optional on success, error message on failure
…ator

Document interface contracts, method semantics, ChangeType enum,
FileEntry record fields, ValidationStatus lifecycle, and the
caller-closes-stream ownership rule.
This commit removes the validation whithin the upload component. This makes the ContentUploadComponent.java simpler.
Also, the ContentUploadComponent.java now supports uploading multiple files. This can be configured by ContentUploadComponent#setMaxFiles.
Also, the max file size can be provided using the UploadConfiguration.java or in the application.properties. Negative values remove the constraint.
- Replace UploadWithDisplay with ContentUploadComponent
- Add EditSampleUploadDisplayController for validation handling
- Reuse SampleUploadDisplay for file display
- Remove deprecated onUploadSucceeded method
…tion

- Replace getElement().executeJs() with setDrawerOpened() method
- Cleaner, type-safe approach using Vaadin's official API
@KochTobi
KochTobi marked this pull request as ready for review August 5, 2026 08:10
@KochTobi
KochTobi requested a review from a team as a code owner August 5, 2026 08:10
KochTobi and others added 13 commits August 5, 2026 13:34
Tried to sort unmodifiable list, now streams, sorts and collects into new sorted list.

# Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
# Co-authored-by: Sven F. <sven1103@users.noreply.github.com>
# Co-authored-by: Shraddha Pawar <Shraddha0903@users.noreply.github.com>
# Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
# Co-authored-by: Sven F. <sven1103@users.noreply.github.com>
# Co-authored-by: Shraddha Pawar <Shraddha0903@users.noreply.github.com>
# Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
# Co-authored-by: Sven F. <sven1103@users.noreply.github.com>
# Co-authored-by: Shraddha Pawar <Shraddha0903@users.noreply.github.com>
# Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
# Co-authored-by: Sven F. <sven1103@users.noreply.github.com>
# Co-authored-by: Shraddha Pawar <Shraddha0903@users.noreply.github.com>
# Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
# Co-authored-by: Sven F. <sven1103@users.noreply.github.com>
# Co-authored-by: Shraddha Pawar <Shraddha0903@users.noreply.github.com>
…tware/data-manager-app into dependencies/upgrade-spring-boot
Co-Authored-By: Biscuit <kochtobi-agent@users.noreply.github.com>
@KochTobi

KochTobi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@sven1103 I addressed the failing CI and the remaining known issues. It would be awesome if you could have a look over the changes. @Steffengreiner As far as I can tell no functionality broke. It would be great to have your opinion as well

@sven1103

sven1103 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@KochTobi the build fails atm, if you can have a look at it so the PR is ready for merge

@KochTobi

Copy link
Copy Markdown
Contributor Author

@KochTobi the build fails atm, if you can have a look at it so the PR is ready for merge

Hi @sven1103

Could not obtain github actions oidc token: 503 Service Unavailable

I removed the debug statements leading to the 503 error. Now it runs.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@Steffengreiner Steffengreiner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done it didn't break and it survived the smoke test and looks awesome! 👍

@KochTobi
KochTobi merged commit 4f41eb5 into main Aug 10, 2026
6 of 7 checks passed
@KochTobi
KochTobi deleted the dependencies/upgrade-spring-boot branch August 10, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants