org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiDocumentationScanner' defined in URL [jar:file:/C:/Java/maven/maven-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:/Java/maven/maven-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:/Java/maven/maven-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:/Java/maven/maven-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:/Java/maven/maven-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 at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-6.0.10.jar:6.0.10]
时间: 2023-12-20 15:07:10 浏览: 262
org.springframework.web.jar
这是一个 Spring 框架的异常信息,具体错误提示是 'UnsatisfiedDependencyException',意味着依赖注入失败。从异常信息中可以看到,出错的地方是在创建名为 'apiDocumentationScanner' 的 bean 时,该 bean 定义在 'ApiDocumentationScanner.class' 文件中。
进一步分析异常信息,发现 'apiDocumentationScanner' 的构造函数有一个参数依赖未满足,而这个参数在创建名为 'apiListingScanner' 的 bean 时也出现了依赖未满足的错误。继续往下追溯,发现 'apiListingScanner' 的构造函数又依赖于 'apiDescriptionReader' bean,而 'apiDescriptionReader' 的构造函数则依赖于 'cachingOperationReader' bean。最后,发现 'cachingOperationReader' 的构造函数又依赖于 'apiOperationReader' bean。
异常信息提示了最终出错的 bean 是 'documentationPluginsManager',它的一个字段 'documentationPlugins' 未能满足依赖。这个字段的类型是 'documentationPluginRegistry',在创建该 bean 时出现了异常。
根据异常信息所示的 jar 包路径可以看到,出错的类都属于 Springfox 框架的一部分。可能的原因是在配置 Springfox 相关的 bean 时出现了问题,可能是依赖版本不匹配或者配置有误。你可以检查一下相关的配置和依赖是否正确,并确保所有的依赖都被正确注入。
阅读全文