-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Can not start spring application with webflux and websocket for ObjectPostProcessor is needed. #14810
Comments
Thanks for the suggestion, but we don’t want to make any changes to the structure of the starters. We’ve improved the documentation in #14069. |
Thanks for your respond. But I don't know why you think you won't want to change the pom. Spring users should use 'org.springframework.boot:spring-boot-starter-websocket' but need excluding 'org.springframework:spring-webmvc'. It is not a good idea, I think. |
We don't want to change it because we don't want to have more starters than we need and we try to compose starters as much as possible. |
Oh, sorry. I didn't mean a web application to only being using WebSockets. I meant an application using websocket with webflux but not webmvc. I agree that spring-boot-starter-web provides many components. I know, for reactive stack we may do more as it comes later (after spring mvc). So you don't want change the spring-boot-starter-web to exclude spring-webmvc. Any way, thanks a lot for your so great framework. |
By the way, I can't find any section to describe this important point. If a user starts a spring application depending on webflux, spring-security and spring-boot-starter-websocket but forgets to exclude spring-mvc they will get failure. |
@macrame We did improve documentation on that in the issue duplicating this one. See: https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/reference/html/boot-features-websockets.html |
Summary
***************************
APPLICATION FAILED TO START
***************************
Description:
A component required a bean of type 'org.springframework.security.config.annotation.ObjectPostProcessor' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.security.config.annotation.ObjectPostProcessor' in your configuration.
Configuration
Version
spring boot 2.0.5.RELEASE
io.spring.platform:platform-bom:Cairo-SR4
org.springframework.cloud:spring-cloud-dependencies:Finchley.SR1
dependencies
...
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.boot:spring-boot-starter-websocket")
...
Solution
I tried again and found that it works well while using dependency of 'org.springframework:spring-websocket' instead of 'org.springframework.boot:spring-boot-starter-websocket'. In deed, spring-boot-starter-websocket depends on 'org.springframework:spring-webmvc' to case this issue. We can exclude 'org.springframework:spring-webmvc' to avoid it.
I suggest that spring-boot-starter-websocket does not depends on 'org.springframework:spring-webmvc' or there is another spring-boot-starter-webflux-websocket which depends on 'org.springframework:spring-webflux' instead of 'org.springframework:spring-webmvc'.
The text was updated successfully, but these errors were encountered: