记一次线上问题排查,原本是一个小问题,但网上的分析和解决方案是这样的(如下),基本都是servlet的问题
https://blog.csdn.net/qq_47455677/article/details/130736215
https://blog.csdn.net/weixin_46828443/article/details/124073358
https://blog.51cto.com/u_16175497/6941643
https://blog.csdn.net/Edward_hjh/article/details/108798859
https://blog.csdn.net/xc10967777/article/details/129697427
排查了两天,没有解决问题,后来发现是我有一个基于@RestControllerAdvice的全局的异常捕获,因为少了配置没有打开,所以服务碰到异常时会抛出,servlet就像返回一个400的错误页面,这个时候就会报这个错,其实比较明显的是“Exception Processing ErrorPage[errorCode=0, location=/error]”这句话,说的便是找不到错误页面ErrorPage。
后来仍然没有解决java.lang.NoSuchMethodError的问题,但是异常被捕获了做了一层包装,返回一个错误提示给到前端。
不知道有哪位大佬解决了,或者有新的解决方案,先mark。
ERROR [o.a.c.core.ContainerBase.[Tomcat].[localhost]] DirectJDKLog.java:175 - Exception Processing ErrorPage[errorCode=0, location=/error]
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;
at org.apache.catalina.core.ApplicationHttpRequest.setRequest(ApplicationHttpRequest.java:714)
at org.apache.catalina.core.ApplicationHttpRequest.<init>(ApplicationHttpRequest.java:113)
at org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationDispatcher.java:920)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:359)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:403)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:249)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:769)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)