Blogger Information
Blog 1
fans 0
comment 0
visits 1099
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Springboot项目整合Swagger2报错
千夜大魔王
Original
1099 people have browsed it

SpringBoot2.2.6整合swagger2.2.2版本的问题,启动SpringBoot报如下错:

  1. Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2. 12:32:32.689 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter
  3. ***************************
  4. APPLICATION FAILED TO START
  5. ***************************
  6. Description:
  7. Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 15 were found:
  8. - modelBuilderPluginRegistry: defined in null
  9. - modelPropertyBuilderPluginRegistry: defined in null
  10. - typeNameProviderPluginRegistry: defined in null
  11. - documentationPluginRegistry: defined in null
  12. - apiListingBuilderPluginRegistry: defined in null
  13. - operationBuilderPluginRegistry: defined in null
  14. - parameterBuilderPluginRegistry: defined in null
  15. - expandedParameterBuilderPluginRegistry: defined in null
  16. - resourceGroupingStrategyRegistry: defined in null
  17. - operationModelsProviderPluginRegistry: defined in null
  18. - defaultsProviderPluginRegistry: defined in null
  19. - pathDecoratorRegistry: defined in null
  20. - relProviderPluginRegistry: defined by method 'relProviderPluginRegistry' in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]
  21. - linkDiscovererRegistry: defined in null
  22. - entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry' in class path resource [org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]
  23. Action:
  24. Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
  25. Process finished with exit code 1

解决办法:swagger2版本改为swagger2.9.2

  1. <dependency>
  2. <groupId>io.springfox</groupId>
  3. <artifactId>springfox-swagger2</artifactId>
  4. <version>2.9.2</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>io.springfox</groupId>
  8. <artifactId>springfox-swagger-ui</artifactId>
  9. <version>2.9.2</version>
  10. </dependency>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post