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
springfox-swagger2:3.0.0-SNAPSHOT Generates conflict of the beans 'requestMappingHandlerAdapter #3342
Comments
Not sure what's causing this. Does the error go away when you remove springfox-swagger2? Is this a spring boot app? Would you be able to create a failing test or replicate it here fixed? so this can be fixed. |
springfox-* seems to use webmvc which causes problems on reactive stack. I've noticed you have made changes in that area recently c9b41dc#diff-4fe0b8294479ac5f5c20c7604ab4cece |
The problem happens to me using spring boot 2.3.0 and springfox-swagger2:3.0.0-SNAPSHOT, once I remove the springfox dependency it works as it should. |
you need to add
to your application.properties |
Thanks, I solved that way, although it doesn't render the endpoints, it says the following: "Unable to render this definition Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.0.n (for example, openapi: 3.0.0)." |
@josuemojena are you setting the DocumentationType.SWAGGER_2 when you initialize a new Docket? |
Yes, I do. |
Look at this. |
@josuemojena try to downgrade to 2.10.5 and see if that solves your issue |
@pmrocha-mindera I can't, because it doesn't support webflux |
@josuemojena it does, 2.10.5 is the latest stable version of the old 3.0.0 snapshot, as their are upgrading the snashopt and some things are in a W.I.P. state they released the 2.10.5 |
If y'all are using spring boot, remove the explicit dependency on swagger2 and add just the dependency on |
Thank you, that's how I solved my problem. |
This should now be fixed |
APPLICATION FAILED TO START
Description:
The bean 'requestMappingHandlerAdapter', defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: