1.Here the ControllerAdviceBean refers to the internal thing in the spring-web not the one in you code.
2.This happens when your application is using Spring Boot 3.x (which depends on Spring Framework 6), but at runtime it loads an old version of spring-web, typically Spring 5.x.
3.The ControllerAdviceBean(Object) constructor exists only in Spring Web 6+. If an older version is loaded, the method is missing, and you get the NoSuchMethodError.
4.Since the error occurs even you are using Springboot 3.4.5 means there is some other dependency in your pom.xml/buil.gradle that's been adding the old spring-web to the classpath.
5.First look for duplicate springweb either jar files in classpath or using the command
./mvnw dependency:tree -Dincludes=org.springframework
6.Look for any unexpected or duplicate versions like:
org.springframework:spring-web:5.x.x <-- BAD
org.springframework:spring-web:6.2.6 <-- GOOD
If you find 5.x.x, find which dependency brought it in :
7. You can do this by checking the dependency tree in IDE and exclude the springweb from it by adding the <exclusion> tag.
<dependency>
<groupId>conflicting.group</groupId>
<artifactId>conflicting-lib</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
Hope this solves your issue this is my first answer in stackoverflow I don't know the standard practices here so please do excuse me if anything seems wrong.