BasicErrorController#error spam on startup, no pages available and view forwarding fails.
See original GitHub issuePlease take the time to search the repository, if your question has already been asked or answered.
v3.0.0
What kind of issue is this?
- Bug report. If you’ve found a bug, spend the time to write a failing test. Bugs with tests or steps to reproduce get fixed faster. Here’s an example: https://gist.github.com/swankjesse/6608b4713ad80988cdc9
My App.java is annotated with @SpringBootApplication
and @EnableOpenApi
@Bean
Docket apiDetails() {
return new Docket(DocumentationType.OAS_30)
.select()
.apis(RequestHandlerSelectors.basePackage("io.ascopes.springboot.usermgmt.controller"))
.build()
.apiInfo(new ApiInfo(
"Spring Boot Microservice Example",
"An MVC microservice example in Spring Boot",
getClass().getPackage().getImplementationVersion(),
null,
new Contact("ascopes", "http://github.com/ascopes", null),
"Unlicense",
"http://unlicense.org/",
Collections.emptyList()
))
.enable(true);
}
@Bean
UiConfiguration uiConfiguration() {
return UiConfigurationBuilder.builder()
.deepLinking(true)
.displayOperationId(false)
.showExtensions(true)
.validatorUrl(null)
.build();
}
On startup, I can hit the swagger-ui endpoint (although it just constantly spam responds with Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually:
, has no content in the response, and repeatedly hits a 404).
In the debug logs, I can just see errors being repeatedly hit by the SpringFox components with no additional details. This goes on forever.
2021-02-14 14:37:47.676 DEBUG 38189 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.746 DEBUG 38189 --- [nio-8080-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.820 DEBUG 38189 --- [nio-8080-exec-4] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.897 DEBUG 38189 --- [nio-8080-exec-5] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:47.972 DEBUG 38189 --- [nio-8080-exec-6] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.048 DEBUG 38189 --- [nio-8080-exec-7] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.123 DEBUG 38189 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.195 DEBUG 38189 --- [nio-8080-exec-9] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2021-02-14 14:37:48.275 DEBUG 38189 --- [io-8080-exec-10] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
Within a debugger, it appears the swagger-ui endpoint itself is causing this spam:
Repo can be found at https://github.com/ascopes/spring-boot-microservice-example/tree/task/swagger
Issue Analytics
- State:
- Created 3 years ago
- Comments:11
Top GitHub Comments
Same problem here
the workaround was not obvious so I’ll try to rephrase it here : Not working :
basepath/swagger-ui
ANDbasepath/swagger-ui/
Working fine :basepath/swagger-ui/index.html
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.