mastodon.online is one of the many independent Mastodon servers you can use to participate in the fediverse.
A newer server operated by the Mastodon gGmbH non-profit

Server stats:

11K
active users

Kerfuffle

Spring Boot 3: Upgrading Javax to Jakarta wasn't hard. Upgrading Spring Security on the other hand...man what a pain.

@kerfuffle Which aspect? Any pointers to documentation you used?

@codesmell Managing transitive dependencies that I didn't know depend on old stuff was one challenge.

The biggest challenge was making build & runtime work, only to find that any request I did resulted in a 403. That was the start of a journey through an elusive filterchain into the depths of and how it's (not) set up in this particular case.

Just reading github.com/spring-projects/spr and github.com/spring-projects/spr helped, but also docs.spring.io/spring-security and docs.spring.io/spring-security

GitHubGitHub - spring-projects/spring-boot: Spring BootSpring Boot. Contribute to spring-projects/spring-boot development by creating an account on GitHub.

@kerfuffle thx for the warning. Not looking forward to a similar exercise. 😑

@codesmell Also I can recommend not shying away from debugstepping through the entire filterchain and putting breakpoints at every doFilter call you come across.

I ended up in the RequestMatcherDelegatingAuthorizationManager, which was using the matchers I set up but coming to different conclusions than previously. Something to do with how default session management has changed (see docs.spring.io/spring-security).

docs.spring.ioSession Management Migrations :: Spring Security

@kerfuffle i just went from "not excited" to "somewhat afraid".

Again, thanks for the warning. This seems like something we'd have to do pretty carefully.

@codesmell You could look at OpenRewrite or Spring Boot Migrator to help you out.

I used IntelliJ Refactor -> Migrate Packages & Classes -> Java EE to Jakarta EE, which did a lot of heavy lifting, and also IntelliJ's Gradle Dependency Analyzer helped find some hidden Javax dependencies.

Stuff like that might mean you can take smaller steps before you take on the task of migrating Spring Security.

@kerfuffle yep, the OpenRewrite route would be interesting for the boring stuff.

@codesmell Yup. It's pretty smooth sailing until you bump into an ancient little library that takes care of some obscure concern that turns out to not have a compatible upgrade and thus needs to be replaced, requiring you to first understand why it's there. Fun times.

@kerfuffle security is always a pain. On any platform. Any time