Swagger在URL中定义的名称为“apiDocumentationScanner”的bean创建时出现错误。

huangapple go评论100阅读模式
英文:

Swagger Error creating bean with name 'apiDocumentationScanner' defined in URL

问题

我无法将Swagger添加到我的项目中。
如果您需要任何信息,我可以分享。
感谢已经观看的每个人。
我还尝试了版本3.0.0,但问题仍然无法解决。

2023-07-27T21:03:45.819+03:00 警告9932 --- [主] ConfigServletWebServerApplicationContext:在上下文初始化期间遇到异常 - 取消刷新尝试:org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为'apiDocumentationScanner'的bean时发生错误,定义在URL [jar:file:/ C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiDocumentationScanner.class]:通过构造函数参数1表示的不满意依赖项:创建名为'apiListingScanner'的bean时发生错误,定义在URL [jar:file:/ C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiListingScanner.class]:通过构造函数参数0表示的不满意依赖项:创建名为'apiDescriptionReader'的bean时发生错误,定义在URL [jar:file:/ C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiDescriptionReader.class]:通过构造函数参数0表示的不满意依赖项:创建名为'cachingOperationReader'的bean时发生错误,定义在URL [jar:file:/ C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/CachingOperationReader.class]:通过构造函数参数0表示的不满意依赖项:创建名为'apiOperationReader'的bean时发生错误,定义在URL [jar:file:/ C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/readers/operation/ApiOperationReader.class]:通过构造函数参数0表示的不满意依赖项:创建名为'documentationPluginsManager'的bean时发生错误:通过字段'documentationPlugins'表示的不满意依赖项:创建名为'documentationPluginRegistry'的bean时,FactoryBean在对象创建时抛出异常。

英文:

I can't add swagger to my project.
I can share information if you need anything.
Thank you to everyone who has already watched.
I also tried version 3.0.0, but still the problem could not be solved
[Swagger在URL中定义的名称为“apiDocumentationScanner”的bean创建时出现错误。](https://i.stack.imgur.com/i8r6L.jpg)

Swagger在URL中定义的名称为“apiDocumentationScanner”的bean创建时出现错误。


2023-07-27T21:03:45.819+03:00  WARN 9932 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiDocumentationScanner' defined in URL [jar:file:/C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiDocumentationScanner.class]: Unsatisfied dependency expressed through constructor parameter 1: Error creating bean with name 'apiListingScanner' defined in URL [jar:file:/C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiListingScanner.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'apiDescriptionReader' defined in URL [jar:file:/C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiDescriptionReader.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'cachingOperationReader' defined in URL [jar:file:/C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/CachingOperationReader.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'apiOperationReader' defined in URL [jar:file:/C:/Users/90539/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/readers/operation/ApiOperationReader.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'documentationPluginsManager': Unsatisfied dependency expressed through field 'documentationPlugins': Error creating bean with name 'documentationPluginRegistry': FactoryBean threw exception on object creation

答案1

得分: 1

我建议您使用springdoc-openapi而不是springfox-swagger2,因为SpringFox基本上已经是一个废弃的项目。springdoc-openapi迁移指南,但在您的情况下,这是一个很好的起点,它将运行得很好。

英文:

i recommend you to use springdoc-openapi instead of springfox-swagger2, becouse SpringFox is for all intents and purposes dead / abandoned project.
springdoc-openapi Migration Guide,
but in your case is a good start and it will work great.

huangapple
  • 本文由 发表于 2023年7月28日 02:14:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76782436.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定