1.6K Star 17.2K Fork 14K

若依 / RuoYi-Cloud

 / 详情

若依cloud版3.5.0 整合knife4j SwaggerHandler找到2个bean

已完成
创建于  
2022-06-14 13:53

只修改了网关服务 ruoyi-gateway

pom文件修改如下:
输入图片说明

错误提示如下:
13:43:12.948 [main] WARN o.s.b.w.r.c.AnnotationConfigReactiveWebServerApplicationContext - [refresh,591] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'swaggerHandler' defined in file [D:\Demo\RuoYi-Cloud-master\ruoyi-gateway\target\classes\com\ruoyi\gateway\handler\SwaggerHandler.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'springfox.documentation.swagger.web.SwaggerResourcesProvider' available: expected single matching bean but found 2: swaggerProvider,inMemorySwaggerResourcesProvider
13:43:12.999 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] -


APPLICATION FAILED TO START


Description:

Parameter 0 of constructor in com.ruoyi.gateway.handler.SwaggerHandler required a single bean, but 2 were found:
- swaggerProvider: defined in file [D:\Demo\RuoYi-Cloud-master\ruoyi-gateway\target\classes\com\ruoyi\gateway\config\SwaggerProvider.class]
- inMemorySwaggerResourcesProvider: defined in URL [jar:file:/D:/apache-maven-3.5.0/repostiory_colud/io/springfox/springfox-swagger-common/3.0.0/springfox-swagger-common-3.0.0.jar!/springfox/documentation/swagger/web/InMemorySwaggerResourcesProvider.class]

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @乐乐 to identify the bean that should be consumed

评论 (6)

SummerLH 创建了任务

采用以下方法解决。
输入图片说明
建议内部修改一下。

你们整合后有没有相关的接口信息,我整合按照这个方式整合成功了但没有接口

页面打开路径改为ip:8080/doc.html

controller上使用@Api(tags = "")注解

方法上使用 @ApiOperation("")注解

若依 任务状态待办的 修改为已完成

这问题咋3.6.2 和 3.6.3 还有这个问题

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(3)
1301973 wang yang work 1606370164
Java
1
https://gitee.com/y_project/RuoYi-Cloud.git
git@gitee.com:y_project/RuoYi-Cloud.git
y_project
RuoYi-Cloud
RuoYi-Cloud

搜索帮助