Repository navigation
Closed
Description
OpenApiResource controller requires org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping from reactive package.
Problem: when the application is deployed to a standalone tomcat server (which is a org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type.SERVLET type), then the application won't start with following error:
[][] 2019-08-05 15:54:46,720 WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'openApiResource': Unsatisfied dependency expressed through field 'requestMappingHandlerMapping'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
[][] 2019-08-05 15:54:46,910 ERROR o.s.b.d.LoggingFailureAnalysisReporter:
***************************
APPLICATION FAILED TO START
***************************
Description:
Field requestMappingHandlerMapping in org.springdoc.api.OpenApiResource required a bean of type 'org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
The following candidates were found but could not be injected:
- Bean method 'cloudFoundryWebFluxEndpointHandlerMapping' in 'ReactiveCloudFoundryActuatorAutoConfiguration' not loaded because not a reactive web application
- Bean method 'webEndpointReactiveHandlerMapping' in 'WebFluxEndpointManagementContextConfiguration' not loaded because not a reactive web application
- Bean method 'controllerEndpointHandlerMapping' in 'WebFluxEndpointManagementContextConfiguration' not loaded because not a reactive web application
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping' in your configuration.
The question is: why is WebMvcAutoConfiguration.EnableWebMvcConfiguration.requestMappingHandlerAdapter() autowiring the RequestMappingHandlerAdapter correctly in a tomcat standalone environment (eg during dev inside the IDE), but not on a standalone tomcat (9.x)?
Metadata
Metadata
Assignees
Labels
No labels
Activity
kodyrecords commentedon Aug 5, 2019
The fault was on my side here: I thought I'd have to add
springdoc-openapi-webflux-uiin case I want swagger ui support for my @GetMapping Flux/Mono endpoints.But that's not the case, so removing the dependency solved that issue.
security: encode path parameters in MCP tool callbacks (scrutineer #19)