我想升级spring boot v2。1.9至2.2.0。但升级后,我得到了一些例外,即spring fox使用的是旧版本的spring插件核心。
有没有其他解决方案,或者我需要放弃springfox插件?
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)
The following method did not exist:
org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;
The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
jar:file:/C:/Users/regosa/.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.RELEASE/spring-plugin-core-2.0.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class
It was loaded from the following location:
file:/C:/Users/regosa/.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.RELEASE/spring-plugin-core-2.0.0.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
maven依赖关系树文件:https://drive.google.com/file/d/1gayvvVe_VsB1P2Hi2rcwRw8NdK89qtbq/view
波姆。xml
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxxxx.business.workflow</groupId>
<artifactId>xxxxx-component-workflow-starter</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>xxxxx-component-workflow-starter</name>
<description>xxxxx-component-workflow-starter</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
<jaxb-runtime.version>2.4.0-b180830.0438</jaxb-runtime.version>
<spring-cloud.version>Greenwich.M1</spring-cloud.version>
<zeebe-version>0.20.1</zeebe-version>
<google-guava.version>27.0.1-jre</google-guava.version>
<xxxxx.version>1.0</xxxxx.version>
<swagger.version>2.9.2</swagger.version>
<jjwt.version>0.9.1</jjwt.version>
<json.version>20180813</json.version>
<slf4j-api.version>1.7.25</slf4j-api.version>
<mysql.version>8.0.11</mysql.version>
<mongo-java-driver.version>3.10.1</mongo-java-driver.version>
<commons-io.version>2.6</commons-io.version>
<commons-lang.version>2.6</commons-lang.version>
<commons-pool2.version>2.5.0</commons-pool2.version>
<redis.version>3.1.0</redis.version>
<velocity.version>1.7</velocity.version>
<velocity-tools.version>2.0</velocity-tools.version>
<logstash-logback-encoder.version>5.3</logstash-logback-encoder.version>
<httpclient.version>4.5.6</httpclient.version>
<jaxb-runtime.version>2.4.0-b180830.0438</jaxb-runtime.version>
<env>local</env>
</properties>
<dependencies>
<!-- Start: Spring Libraries -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<!-- End: Spring Libraries -->
<!-- Adding JAXB Runtime since it is not shipped with JDK 9+ -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb-runtime.version}</version>
</dependency>
<!-- Start: xxxxx Libraries -->
<dependency>
<groupId>com.xxxxx</groupId>
<artifactId>xxxxx-entity</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<dependency>
<groupId>com.xxxxx</groupId>
<artifactId>xxxxx-redis</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<dependency>
<groupId>com.xxxxx</groupId>
<artifactId>xxxxx-mongo</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<dependency>
<groupId>com.xxxxx</groupId>
<artifactId>xxxxx-util</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<dependency>
<groupId>com.xxxxx.model</groupId>
<artifactId>xxxxx-model</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<dependency>
<groupId>com.xxxxx.service</groupId>
<artifactId>xxxxx-common-service</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<dependency>
<groupId>com.xxxxx.service</groupId>
<artifactId>xxxxx-common-messaging</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<dependency>
<groupId>com.xxxxx.service</groupId>
<artifactId>xxxxx-common-security</artifactId>
<version>${xxxxx.version}</version>
</dependency>
<!-- End: xxxxx Libraries -->
<!-- Adding Zeebe client as part of the Spring Startup -->
<dependency>
<groupId>io.zeebe</groupId>
<artifactId>zeebe-client-java</artifactId>
<version>${zeebe-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${google-guava.version}</version>
</dependency>
<!-- Logstash Log Encoder -->
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback-encoder.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mongodb/mongo-java-driver -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>${mongo-java-driver.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>${commons-pool2.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>${redis.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<!-- Start: Swagger Libraries -->
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!-- End: Swagger Libraries -->
<!-- Start: Spring Boot and Security Test Libraries -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- End: Spring Boot and Security Test Libraries -->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>xxxxx-component-workflow-starter</finalName>
<filters>
<filter>${env}-build.properties</filter>
</filters>
<resources>
<resource>
<filtering>true</filtering>
<directory>${project.basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>com.xxxxx.business.workflow.component.starter</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
显然,由于SpringFox已被放弃,其最新版本不再与Spring Boot 2.2兼容。十、 您必须寻找替代方案(请参阅Github中报告的问题)。
一种可能的选择是使用OpenAPI文档
。为此,您需要删除SpringFox
依赖项并添加以下内容:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.2.15</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webmvc-core</artifactId>
<version>1.2.15</version>
</dependency>
此外,您还必须删除Swagger
配置类,并提供以下内容:
@Configuration
public class OpenApiConfig {
@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.components(new Components())
.info(new Info().title("Contact Application API").description(
"This is a sample Spring Boot RESTful service using springdoc-openapi and OpenAPI 3."));
}
}
在我的例子中,除了没有公开的JPA Rest存储库之外,其他一切似乎都正常工作。如果我找到了,我会更新这个答案。
以下是我为修复此问题而检查的一些链接:
您可以将SpringFox 3.0.0-SNAPSHOT
与Spring Boot 2.2一起使用。X
@EnableSwagger2
被删除并更改为@EnableSwagger2WebMvc
和@EnableSwagger2WebFlux
马文
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-data-rest</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
仓库
<repositories>
<repository>
<id>jcenter-snapshots</id>
<name>jcenter</name>
<url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
</repository>
</repositories>
示例配置
@EnableSwagger2WebMvc
@Import(SpringDataRestConfiguration.class)
public class SpringFoxConfig {
//...
}
参考文献
>
https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api
注意:似乎SpringFox
没有死。
固定的
这个问题存在于Spring fox库内部依赖于sping-plugin-core: 1.2.0,但它实际上需要sping-plugin-core: 2.0.0。在支持网络流量的swagger库的SNAPSHOT版本中,这种依赖修正似乎缺失了。
我们只需要纠正Maven的依赖关系,如下所示,不需要更改代码:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-webflux</artifactId>
<version>3.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
@Configuration
@EnableSwagger2WebFlux
public class SwaggerConfiguration {
@Bean
public Docket api(final TypeResolver typeResolver) {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
我试图让ESLint让我使用对象的Rest/传播。尽管我尽了最大努力,我还是得到了这个错误: 当我悬停在椭圆上时(<代码>...)用红色弯弯曲曲。 我的看起来像这样: 我确信prefs正在被阅读,因为规则、插件和样式指南正在按预期工作。 要启用对象rest/spread,是这里的关键(哈哈),它似乎对其他人有用。然而,它拒绝为我工作。我不知所措 更新:我使用的是Visual Studio代码v1.
我用NodeJS和Socketio开发了聊天程序。然后我部署到Heroku服务器,发现SocketIO在Heroku中不工作。 我已经检查了Heroku的日志,但什么都没有。但奇怪的是,它在localhost环境中工作,而不是在Heroku环境中。我想端口设置有些问题。 [服务器端代码] “客户端代码” 第一次,我只是使用代码,它在Localhost env中工作得很好。但是在部署到heroku之
我使用一个包在Flutter中,它可以在Android上正常工作,但是当在ios模拟器上运行我的项目时,我在控制台中收到错误。 当我运行时,我得到以下错误,由于内容长度,我删除了错误的一些重复部分。 我在上面的错误中找不到任何相关消息这是 这就是我与pusher的连接方式 但在我注释掉上述文件和<code>pusher_client:^2.0.0<code>中的<code>时。yaml然后运行<c
错误:活动:自2018-04-09周一16:35:28 IST以来失败(结果:退出代码);进程:22654 ExecStart=/usr/sbin/nginx(代码=退出,状态=1/失败)Apr 09 16:35:28 localhost。localdomain systemd[1]:无法启动nginx HTTP和反向代理服务器。
我从官方网站学习Angular 4,我通过ngModel学习了双向数据绑定部分。但是,只要我将[(ngModel)]添加到组件模板中,我的应用程序就会停止工作,即使FormsModule已导入模块中。ts文件。组件未加载 我正在使用Visual Studio代码<这是我的应用程序。组成部分ts 这是一个应用程序。单元ts AppComponent没有加载,只是显示 加载。。。
我有一个视频流服务器,它能够使用rtp通过摄像头捕获视频帧。我的android mobile作为客户端,能够通过以下管道传输输出: udpsrc端口=5004!应用程序/x-rtp,时钟速率=90000,编码名称=(字符串)H264,有效负载=96!队列rtph264depay!H264解析!decodebin!自动视频接收器 但是,如果我用fpsdisplysink替换autoVideosink
我正在使用Liquibase 3.3.2并尝试实现一个Web服务,该服务接受许多变更日志,根据上下文查找特定的数据源,并将该数据源与Liquibase变更日志一起使用以执行数据库更新。 我使用PostgreSQL作为数据库。 不知何故,来自webservice端的liquibase日志表明根本没有问题,似乎都在正确执行。但是,数据库中没有任何表,甚至没有Liquibase自己的锁/状态表。。 这是
我有一个简单的属性转换实现,在这个实现中,我试图注入一个必须提供转换逻辑的对象,但是似乎不适合这种情况。转换器类看起来像这样: 当被触发时,它会抛出一个,因为属性没有从容器中初始化。为什么? 我使用的是Glassfish 4,在所有其他情况下,都可以正常工作。 不可能在转换器上使用CDI吗? 任何帮助都将不胜感激:) 我的问题的重点更多的是属性转换部分。我明白要让CDI工作,bean必须满足这里描