[Handler dispatch failed; nested exception is java.lang.NoSuchMethodError...]

2,924 阅读1分钟

环境信息:

image.png

image.png

image.png

报错信息:

严重: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;] with root cause
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;

解决

在搜索别人报错的解决方法中,大多是修改tomcat或springboot版本

参考链接: blog.csdn.net/cdnight/art… www.jianshu.com/p/cdfb42956…

我这遇到的也差不多, 修改了servlet-api版本, 项目默认引入的是3.1版本, 升级到4.0.1解决