79313786

Date: 2024-12-28 12:44:37
Score: 1.5
Natty:
Report link

I am encountering the same issue as you. I am using the following versions in my pom.xml:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.4.1</version>
    <relativePath/>
</parent>

<dependencies>
    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
        <version>2.7.0</version>
    </dependency>
</dependencies>

I was facing the java.lang.NoSuchMethodError,

Caused by: java.lang.NoSuchMethodError: 'void org.springframework.web.method.ControllerAdviceBean.<init>(java.lang.Object)'

but I was able to resolve it by using @Hidden from SpringDoc. Specifically, you need to add @Hidden on your @RestControllerAdvice or @ControllerAdvice classes (see the documentation here: SpringDoc - How to hide an operation or controller).

@Slf4j
@Hidden
@RestControllerAdvice
public class GlobalHandler extends ResponseEntityExceptionHandler {
...
}

This solution provides a temporary fix while using the versions of Spring Boot and SpringDoc that I want, without causing any errors.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Hidden
  • User mentioned (0): @Hidden
  • User mentioned (0): @RestControllerAdvice
  • User mentioned (0): @ControllerAdvice
  • Low reputation (1):
Posted by: Jérémy Woirhaye