Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServl

两种解决方式:

以Application方式启动,在pom中把tomcat的scope改为compile

 
        
            org.springframework.boot
            spring-boot-starter-tomcat
            compile
        

以spring-boot:run(maven方式)方式启动工程
(IDEA工具)

  • Run–》Edit Configurations–》+—》选择Maven–》配置命令为spring-boot:run
  • 右上角选择启动方式

Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServl_第1张图片

=========================================================
下面说一下主要造成原因,因为我们直接运行application类,而我们的servlet-api等依赖tomcat的库的scope为provide,所以我们的tomcat的scope需要改为compile
以spring-boot:run方式启动相当于直接部署工程到tomcat中,所以tomcat的scope为provide也不会影响

你可能感兴趣的:(spring,boot)