Spring Boot 启动出现 requestMappingHandlerAdapter 错误

时间:2025-04-20 18:19:37

: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$]: Bean instantiation via factory method failed; nested exception is : Failed to instantiate []: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is :

因为在文件中写了2个启动类,只需要写一个就可以了

<dependency>
    <groupId></groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.0.</version>
</dependency>
<dependency>
      <groupId></groupId>
      <artifactId>spring-boot-starter-web</artifactId>
</dependency>