我正在使用 spring cloud 将模块化应用程序迁移到微服务应用程序,当我完成将模块迁移到微服务并运行它时,出现了一个问题:
更正应用程序的类路径,使其包含 org.springframework.plugin.core.PluginRegistry 的单个兼容版本
这是错误:
试图调用不存在的方法。尝试是从以下位置进行的:
org.springframework.data.rest.core.support.UnwrappingRepositoryInvokerFactory.<init>(UnwrappingRepositoryInvokerFactory.java:57)
以下方法不存在:
org.springframework.plugin.core.PluginRegistry.of(Ljava/util/List;)Lorg/springframework/plugin/core/PluginRegistry;
该方法的类 org.springframework.plugin.core.PluginRegistry 可从以下位置获得:
jar:file:/~/.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
它是从以下位置加载的:
文件:/~/.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 :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<父>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.0.RELEASE</version>
<relativePath/> <!-- 从存储库中查找父级 -->
</父>
<groupId>org.sid</groupId>
<artifactId>SF-postpros</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SF-postpros</name>
<description>Spring Boot 演示项目</description>
<属性>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.SR4</spring-cloud.version>
</属性>
<依赖>
<依赖>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<排除>
<排除>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</排除>
</排除>
</依赖>
<依赖>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>运行时</scope>
</依赖>
<依赖>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</依赖>
<依赖>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</依赖>
<依赖>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId> …