-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
引入springboot3.4后v3/api-docs接口报Handler dispatch failed: java.lang.NoSuchMethodError #867
Comments
你这个问题不是knife4j导致的,而是旧版本的springdoc的问题,升级到springdoc-2.7.0这个问题会消失,但会出现新问题。新问题出现在库knife4j-openapi3-jakarta-spring-boot-starter的Knife4jOpenApiCustomizer类第75行,由于springdoc的SpringDocConfigProperties.getGroupConfigs返回类型由List变为Set,导致抛出NoSuchMethod异常。解决方法也很简单,下载4.5.0的源码,升级pom中的版本到你希望的版本,重新编译即可。我编译了一个自己的4.5.1版本,目前为止文档都是正常的,当然,不排除其他地方还可能出现类似的兼容性错误,但那也只有发生了才会知道。 |
可以先用这个 |
好的,谢谢。这个是正式版本还是临时版本,我在maven仓库里面没看到 |
这个是我在原版源码上改的,并发布在maven上,方便自己和大家使用.今天刚发布,同步可能需要最长48小时.目前,可以在central仓库看到[1] |
谁叫你改包名,搞到我项目全部都要改包名为“幸福的事【xingfudeshi】” |
不改包名,无法发布到maven仓库,会和原项目冲突。
…------------------ 原始邮件 ------------------
From: rayliang123 ***@***.***>
发送时间: 12/06/2024, 21:41
To: xiaoymin/knife4j ***@***.***>
抄送: xingfudeshi ***@***.***>, Comment ***@***.***>
Subject: Re: [xiaoymin/knife4j] 引入springboot3.4后v3/api-docs接口报Handler dispatch failed: java.lang.NoSuchMethodError (Issue #867)
<dependency> <groupId>com.github.xingfudeshi</groupId> <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId> <version>4.6.0</version> </dependency>
可以先用这个
谁叫你改包名,搞到我项目全部都要改包名为“幸福的事【xingfudeshi】”
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
|
可以了,感谢 |
老老实实自己打私服吧 别用这个 包名都换了 以后切回来麻烦 |
包名更换是因为发布到maven中央仓库,需要用不同namespace,否则会冲突。不想用可以不用。 |
描述
knife4j-openapi3-jakarta-spring-boot-starter+springboot3.4后请求/v3/api-docs报如下异常:
Handler dispatch failed: java.lang.NoSuchMethodError: 'void org.springframework.web.method.ControllerAdviceBean.<init>(java.lang.Object)
分析错误后发现:
org.springdoc.core.service.GenericResponseService.lambda$getGenericMapResponse$8(GenericResponseService.java:702)
此处代码:
new ControllerAdviceBean(controllerAdviceInfo.getControllerAdvice()).isApplicableToBeanType(beanType))
用到了ControllerAdviceBean类的一个参数的构造函数,但是springboot3.4已经移除,只有一个三个构造函数的参数:
public ControllerAdviceBean(String beanName, BeanFactory beanFactory, ControllerAdvice controllerAdvice) {
能不能快速兼容一下发一个版本,谢谢
The text was updated successfully, but these errors were encountered: