java.lang.NoSuchMethodException:(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServl ╰+哭是因爲堅強的太久メ 2022-04-12 04:56 193阅读 0赞 > ** 如果我的博客能够帮到大家能够点个赞,关注一下,以后还会更新更过JavaWeb的高级技术,大家的支持就是我继续更新的动力。谢谢。** > 做Demo的过程中遇到如下错误: > > java.lang.NoSuchMethodException: com.nyist.web.servlet.ProductsServlet.findByPage(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) > at java.lang.Class.getMethod(Class.java:1786) > at com.nyist.web.servlet.BaseServlet.service(BaseServlet.java:34) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at com.nyist.web.filter.EncodingFilter.doFilter(EncodingFilter.java:38) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) > at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) > at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) > at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) > at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) > at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651) > at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) > at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) > at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498) > at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) > at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796) > at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1374) > at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) > at java.lang.Thread.run(Thread.java:745) > 十二月 01, 2018 2:54:17 下午 org.apache.catalina.core.StandardWrapperValve invoke > 严重: Servlet.service() for servlet [ProductsServlet] in context with path [/store] threw exception > java.lang.RuntimeException: 问题正在抢修中 > at com.nyist.web.servlet.BaseServlet.service(BaseServlet.java:46) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at com.nyist.web.filter.EncodingFilter.doFilter(EncodingFilter.java:38) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) > at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) > at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) > at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) > at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) > at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651) > at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) > at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) > at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498) > at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) > at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796) > at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1374) > at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) > at java.lang.Thread.run(Thread.java:745) > > 错误原因:是因为方法中,HttpServletRequest request,HttpServetResponse response 这俩个参数的位置写反了 > > 解决办法: 第一个参数写request,第二个写response
还没有评论,来说两句吧...