springboot 启动报错: Multiple Dockets with the same group name are not supported. The following duplicat

﹏ヽ暗。殇╰゛Y 2022-12-21 10:58 220阅读 0赞

报错详情

org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.IllegalStateException: Multiple Dockets with the same group name are not supported. The following duplicate groups were discovered. default

…..

Caused by: java.lang.IllegalStateException: Multiple Dockets with the same group name are not supported. The following duplicate groups were discovered. default

截图

  1. org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.IllegalStateException: Multiple Dockets with the same group name are not supported. The following duplicate groups were discovered. default
  2. at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185)
  3. at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
  4. at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
  5. at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
  6. at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
  7. at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:894)
  8. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
  9. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)
  10. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
  11. at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
  12. at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
  13. at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
  14. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
  15. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
  16. at com.lucas.template.TemplateApplication.main(TemplateApplication.java:18)
  17. Caused by: java.lang.IllegalStateException: Multiple Dockets with the same group name are not supported. The following duplicate groups were discovered. default
  18. at springfox.documentation.spring.web.plugins.DuplicateGroupsDetector.ensureNoDuplicateGroups(DuplicateGroupsDetector.java:45)
  19. at springfox.documentation.spring.web.plugins.DocumentationPluginsManager.documentationPlugins(DocumentationPluginsManager.java:97)
  20. at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:162)
  21. at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
  22. ... 14 common frames omitted

查找原因

在网上根据这个报错搜索了一番,各种答案都和我这个好像没有关系,而且他们的解答好像都是复制了,都没说明原因

那就只能自己想办法解决,报错解释:不支持具有相同组名的多个文档。发现以下重复组。default

完全没有头绪,default ,然后mvn pakcage -X 打包查询也是相同的错误,没有更详细的原因,

问题点

根据报错提供的 documentationPluginsBootstrapper 和 DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185) 和 报错打印

找到 DefaultLifecycleProcessor 中抛出异常的地方,找到

  1. DocumentationPluginsBootstrapper.start() 方法报错,debug ,找出更深层的报错 DocumentationPluginsManager.documentationPlugins()

最后发现是有两个 Swagger 文档的配置类,然后去掉其中一个就恢复正常了

发表评论

表情:
评论列表 (有 0 条评论,220人围观)

还没有评论,来说两句吧...

相关阅读