IDEA添加Swagger2:Parameter 0 of method linkDiscoverers in org. springframework hateoas.config.Hateoasconfiguration required a single bean, but 15 were found:

本文涉及的产品
服务治理 MSE Sentinel/OpenSergo,Agent数量 不受限
可观测监控 Prometheus 版,每月50GB免费额度
应用实时监控服务-可观测链路OpenTelemetry版,每月50GB免费额度
简介: IDEA添加Swagger2:Parameter 0 of method linkDiscoverers in org. springframework hateoas.config.Hateoasconfiguration required a single bean, but 15 were found

1.异常复现

#一开始我写的依赖是这个然后报错 

<dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.2.2</version>
        </dependency>
<dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.2.2</version>
        </dependency>

image.png 2.问题解决

#替换依赖

<dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>3.0.0</version>
        </dependency>

然后访问地址改为:http://localhost:8080/swagger-ui/index.html

目录
打赏
0
3
3
0
56
分享
相关文章
|
7月前
|
springcloud-config客户端启用服务发现报错找不到bean EurekaHttpClient
解决 Spring Cloud Config 客户端启用服务发现时报错找不到 bean `EurekaHttpClient` 的问题,主要涉及版本兼容性、依赖配置和正确的配置文件设置。通过检查依赖版本、添加必要的依赖项、配置文件的正确性以及启用服务发现注解,可以有效解决此问题。确保日志中没有其他错误信息也是关键步骤之一。通过这些方法,可以确保 Spring Cloud Config 与 Eureka 客户端正常工作。
133 6
springboot 集成 swagger 2.x 和 3.0 以及 Failed to start bean ‘documentationPluginsBootstrapper‘问题的解决
本文介绍了如何在Spring Boot项目中集成Swagger 2.x和3.0版本,并提供了解决Swagger在Spring Boot中启动失败问题“Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerEx”的方法,包括配置yml文件和Spring Boot版本的降级。
springboot 集成 swagger 2.x 和 3.0 以及 Failed to start bean ‘documentationPluginsBootstrapper‘问题的解决
No application config found or it‘s not a valid config! Please add <dubbo:application name=“...“ />
No application config found or it‘s not a valid config! Please add <dubbo:application name=“...“ />
1590 1
idea整合EasyCode基于lombok和swagger自定义模板
idea整合EasyCode基于lombok和swagger自定义模板
421 0
IntelliJ IDEA中执行@Test单元测试时报错Class not found: "..."终极办法
IntelliJ IDEA中执行@Test单元测试时报错Class not found: "..."终极办法
614 0
Mysql-错误处理: Found option without preceding group in config file
Mysql-错误处理: Found option without preceding group in config file
1256 0
【Default config not found for ApplicationConfig】的一种解决方案
【Default config not found for ApplicationConfig】的一种解决方案
971 0
SpringBoot集成swagger后出现: Failed to start bean ‘documentationPluginsBootstrapper‘的解决方法
SpringBoot集成swagger后出现: Failed to start bean ‘documentationPluginsBootstrapper‘的解决方法
675 0
IDEA创建Spring项目时没有Spring Config的XML文件
IDEA创建Spring项目时没有Spring Config的XML文件
1017 0

云原生

+关注
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问