xiaoymin / knife4j

Knife4j is a set of Swagger2 and OpenAPI3 All-in-one enhancement solution
https://doc.xiaominfo.com
Apache License 2.0
4.07k stars 613 forks source link

SpringBoot 3.3.2集成knife4j-aggregation-spring-boot-starter启动失败 #829

Open janusdo opened 3 weeks ago

janusdo commented 3 weeks ago

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:

com.github.xiaoymin.knife4j.aggre.spring.configuration.Knife4jAggregationAutoConfiguration.routeProxyFilter(Knife4jAggregationAutoConfiguration.java:118)

The following method did not exist:

'void org.springframework.boot.web.servlet.FilterRegistrationBean.setFilter(javax.servlet.Filter)'

The calling method's class, com.github.xiaoymin.knife4j.aggre.spring.configuration.Knife4jAggregationAutoConfiguration, was loaded from the following location:

jar:file:/D:/Program%20Files/Apache%20Software/maven-repository/com/github/xiaoymin/knife4j-aggregation-spring-boot-starter/4.5.0/knife4j-aggregation-spring-boot-starter-4.5.0.jar!/com/github/xiaoymin/knife4j/aggre/spring/configuration/Knife4jAggregationAutoConfiguration.class

The called method's class, org.springframework.boot.web.servlet.FilterRegistrationBean, is available from the following locations:

jar:file:/D:/Program%20Files/Apache%20Software/maven-repository/org/springframework/boot/spring-boot/3.3.2/spring-boot-3.3.2.jar!/org/springframework/boot/web/servlet/FilterRegistrationBean.class

The called method's class hierarchy was loaded from the following locations:

org.springframework.boot.web.servlet.FilterRegistrationBean: file:/D:/Program%20Files/Apache%20Software/maven-repository/org/springframework/boot/spring-boot/3.3.2/spring-boot-3.3.2.jar
org.springframework.boot.web.servlet.AbstractFilterRegistrationBean: file:/D:/Program%20Files/Apache%20Software/maven-repository/org/springframework/boot/spring-boot/3.3.2/spring-boot-3.3.2.jar
org.springframework.boot.web.servlet.DynamicRegistrationBean: file:/D:/Program%20Files/Apache%20Software/maven-repository/org/springframework/boot/spring-boot/3.3.2/spring-boot-3.3.2.jar
org.springframework.boot.web.servlet.RegistrationBean: file:/D:/Program%20Files/Apache%20Software/maven-repository/org/springframework/boot/spring-boot/3.3.2/spring-boot-3.3.2.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes com.github.xiaoymin.knife4j.aggre.spring.configuration.Knife4jAggregationAutoConfiguration and org.springframework.boot.web.servlet.FilterRegistrationBean

kingerpku commented 2 weeks ago

exactly the same issue here