【问题标题】:spring boot application is failing to start when i enable swagger当我启用 swagger 时,spring boot 应用程序无法启动
【发布时间】:2021-04-25 16:59:20
【问题描述】:

说明:

试图调用一个不存在的方法。尝试是从以下位置进行的: org.springframework.data.rest.core.support.UnwrappingRepositoryInvokerFactory.(UnwrappingRepositoryInvokerFactory.java:57)

以下方法不存在: org.springframework.plugin.core.PluginRegistry.of(Ljava/util/List;)Lorg/springframework/plugin/core/PluginRegistry; 该方法的类 org.springframework.plugin.core.PluginRegistry 可从以下位置获得: jar:file:/C:/Users/182588/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar!/ org/springframework/plugin/core/PluginRegistry.class

类层次结构是从以下位置加载的:

org.springframework.plugin.core.PluginRegistry: file:/C:/Users/182588/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar

行动: 更正应用程序的类路径,使其包含一个兼容的 org.springframework.plugin.core.PluginRegistry 版本

我在 pom.xml 中添加了下面的依赖

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.9.2</version>
</dependency>
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>2.9.2</version>
</dependency> 

【问题讨论】:

  • 您应该在此处粘贴完整的异常堆栈信息,以便其他人解决问题。

标签: spring spring-boot swagger springfox


【解决方案1】:

添加这个依赖,它可能会起作用

<dependency>
            <groupId>org.springframework.plugin</groupId>
            <artifactId>spring-plugin-core</artifactId>
            <version>1.2.0.RELEASE</version>
 </dependency>

【讨论】:

  • 添加上述依赖后就可以工作了
猜你喜欢
  • 2015-05-10
  • 2020-08-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-07-26
相关资源
最近更新 更多