Cannot find MessageMatcherDelegatingAuthorizationManager class while trying to configure websocket security in Spring Boot 3
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
If MessageMatcherDelegatingAuthorizationManager cannot be found in a Spring Boot 3 project, the problem is usually not the import statement itself. It is almost always one of three things: the messaging-security module is missing, Spring Security versions are out of alignment, or the code was copied from a different generation of the Spring Security API.
Boot 3 uses Spring Framework 6 and Spring Security 6 style configuration. That means WebSocket message security should be approached with the current AuthorizationManager-based pattern, not older adapter-based examples.
First Check the Classpath
The class lives in Spring Security's messaging support, not in the generic web starter. That means a typical setup needs:
- '
spring-boot-starter-security' - '
spring-boot-starter-websocket' - '
spring-security-messaging'
For Maven, the dependency section usually includes something like this:
If that module is missing, the class will not exist at compile time no matter how many imports you try.
Do Not Override Spring Security Versions Randomly
The next thing to check is version alignment. Spring Boot manages compatible Spring Security versions through its dependency management. If you manually pin one Spring Security artifact to a different version, you can end up with a classpath where examples from one version do not match the jars you actually resolved.
That is why the next command is usually more useful than more coding:
Or, in Gradle:
If the tree shows mixed major or minor versions, fix that first. Configuration code is not stable when the classpath itself is incoherent.
Use the Current AuthorizationManager Style
In Spring Security 6 style WebSocket security, the usual pattern is to define an AuthorizationManager<Message<?>> bean and build it with MessageMatcherDelegatingAuthorizationManager.Builder:
If this still does not compile after adding spring-security-messaging, you almost certainly still have a dependency-alignment issue.
Keep Broker Configuration and Security Rules Consistent
Security matchers should line up with the destinations configured in your message broker:
If the broker prefixes and the security matchers disagree, you can end up chasing the wrong bug. The missing-class error is a compile-time problem, but runtime authorization problems often come immediately after it.
Do Not Mix Old and New Examples
A lot of confusion comes from mixing:
- Boot 3 dependencies
- Spring Security 5 era blog posts
- deprecated adapter-style configuration
- current builder-based examples
Pick the configuration style that matches the dependencies you actually run. Trying to patch an outdated example one missing class at a time usually makes the security setup harder to understand.
Common Pitfalls
The most common mistake is assuming spring-boot-starter-security automatically includes messaging security support. It does not give you every optional module.
Another common issue is overriding Spring Security versions while still expecting Spring Boot's examples to compile unchanged. Once version alignment breaks, missing-class errors become very likely.
Developers also spend time debugging HTTP security even though the problem is in STOMP message authorization dependencies. Web and messaging security share concepts, but they do not live in exactly the same module set.
Finally, avoid copying examples blindly from older answers that extend deprecated classes. Boot 3 projects should use the current authorization-manager approach.
Summary
- Missing
MessageMatcherDelegatingAuthorizationManagerusually means missingspring-security-messagingor broken dependency alignment. - Let Spring Boot manage compatible Spring Security versions whenever possible.
- Use the current
AuthorizationManager<Message<?>>bean style for WebSocket message security. - Keep your STOMP destination prefixes and security matchers aligned.
- Do not mix Boot 3 code with older adapter-based Spring Security examples.
Related reading
- Cannot Inject Dependencies into ASP.NET Web API Controller using Unity
- Cannot ping AWS EC2 instance
- Cannot send a content-body with this verb-type
- CannotStartContainerError API error 400 OCI runtime create failed container_linux.go348 starting container process caused
- Cannot login to Docker account
- Cannot read credentials from /.aws/credentials - PHP script call AWS-SDK
- Cannot get maven project.version property in a Spring application with Value
- Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6
System design interview problems on this topic
- Design a Load Balancer: solution and walkthrough
- Design a Domain Name System: solution and walkthrough
- Design a Global Content Distribution Network: solution and walkthrough
- Design an API Rate Limiter: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.