Reputation: 101
I haven't changed its pom.xml for this project, but when I started the project recently, it reported this error: java.lang.NoSuchMethodError. Seeing the error, it seems that it can't find the interface method I wrote.
2020-07-21 10:23:05.212 ERROR [main] ApiDescriptionReader::read[#87] : Skipping process path[/projects], method[addProject] as it has an error.java.lang.NoSuchMethodError: org.springframework.http.MediaType.equalsTypeAndSubtype(Lorg/springframework/util/MimeType;)Z
at springfox.documentation.builders.BodyParameterSpecificationProvider.lambda$create$0(BodyParameterSpecificationProvider.java:37)
... ...
I tried mvn clean install, it still doesn't work. This is the io.springfox dependency tree:
[INFO] +- org.springframework.retry:spring-retry:jar:1.2.4.RELEASE:compile
[INFO] | \- org.springframework:spring-core:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.0.7.RELEASE:compile
[INFO] +- org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:2.0.0:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.3.RELEASE:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.0.7.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-webflux:jar:5.0.7.RELEASE:compile
[INFO] \- org.springframework.plugin:spring-plugin-core:jar:2.0.0.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:5.0.7.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.0.7.RELEASE:compile
[INFO] \- org.springframework:spring-aop:jar:5.0.7.RELEASE:compile
[INFO] +- io.springfox:springfox-swagger2:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-spi:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-schema:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-swagger-common:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-spring-web:jar:3.0.0-SNAPSHOT:compile
[INFO] | \- io.springfox:springfox-spring-webmvc:jar:3.0.0-SNAPSHOT:compile
[INFO] +- io.springfox:springfox-swagger-ui:jar:3.0.0-SNAPSHOT:compile
[INFO] \- io.springfox:springfox-spring-webflux:jar:3.0.0-SNAPSHOT:compile
[INFO] \- io.springfox:springfox-core:jar:3.0.0-SNAPSHOT:compile
Upvotes: 1
Views: 5185
Reputation: 251
According to the documentation this method exists since spring 5.1.4
You can update the version of spring that you use or decrease the version of spring-fox
Upvotes: 4