4.5K Star 42.9K Fork 12.6K

GVPlengleng / pig

 / 详情

新增的服务接入 pigx-common-swagger后,无法启动问题

已完成
成员
创建于  
2022-01-12 17:04
  • 提问务必按以下模板,提交详细信息。

  • 错误信息多多益善、错误截图多多益善。



环境信息

  • pigx版本: 4.0.0

  • 是否修改包名: 是

提供详细日志、截图、回显步骤

新加了一个服务wfs,原先使用的是普通的swagger组件springfox-boot-starter,可以正常看swagger,但是加了权限包pigx-common-security依赖之后,swagger因为权限问题无法访问了。所以就引入了咱们的 pigx-common-swagger依赖,但是再启动时发现项目无法启动了。报错信息:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'inMemorySwaggerResourcesProvider' defined in URL [jar:file:/D:/m2repository/io/springfox/springfox-swagger-common/3.0.0/springfox-swagger-common-3.0.0.jar!/springfox/documentation/swagger/web/InMemorySwaggerResourcesProvider.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [springfox.documentation.swagger.web.InMemorySwaggerResourcesProvider]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Multiple Dockets with the same group name are not supported. The following duplicate groups were discovered. default
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:315)

评论 (5)

Github Action 创建了任务
  • 如果你 wfs 不是使用 我们提供的骨架工程生成 ,就没有办法引用 common-swagger

  • 你demo-biz 服务新增 common-swagger 是否正常?

  • 如果你 wfs 不是使用 我们提供的骨架工程生成 ,就没有办法引用 common-swagger

  • 你demo-biz 服务新增 common-swagger 是否正常?

demo-biz 服务新增 common-swagger 是正常的

但是加了common-security包依赖以后,wfs就不能访问swagger了,也不行啊。我尝试认证服务pigx-auth项目的WebSecurityConfigurer的configure方法增加 .and().authorizeRequests().antMatchers("/token/", "/actuator/", "/mobile/", "/swagger-ui.html/").permitAll()
增加允许访问/swagger-ui.html的配置,结果还是提示没有权限

嗯 还是按我说的 你使用 骨架创建一个标准的微服务 ,然后把你wfs 里面的代码移动过去

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

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
410595 log4j 1591768487 393021 springcloud777 1591517090
Java
1
https://gitee.com/log4j/pig.git
git@gitee.com:log4j/pig.git
log4j
pig
pig

搜索帮助