英文:
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
[](https://i.stack.imgur.com/i8r6L.jpg)
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论