参数-struts处理请求,异常:java.lang.NoSuchMethodException

问题描述

struts处理请求,异常:java.lang.NoSuchMethodException

[ERROR]2016-04-08 10:03:01,872 MESSAGE : Action[/business/bank] does not contain method named 'ZXBack?client_order_no=1234567895179'
java.lang.NoSuchMethodException: com.wlt.webm.business.action.NetPayAction.ZXBack?client_order_no=1234567895179(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:322)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:262)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.wlt.webm.filter.UserSessionValidateFilter.doFilter(UserSessionValidateFilter.java:184)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.wlt.webm.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
[ERROR]2016-04-08 10:03:01,878 MESSAGE :
java.lang.NoSuchMethodException: com.wlt.webm.business.action.NetPayAction.ZXBack?client_order_no=1234567895179(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:322)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:262)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.wlt.webm.filter.UserSessionValidateFilter.doFilter(UserSessionValidateFilter.java:184)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.wlt.webm.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

解决方案

不久前在学习struts时出现这个错误,在网上搜索了半天,发现答案不一。将其总结如下,以方便大家参考。

1、你有没有试试看 其它的方法能不能用,要是都是这种情况的话,可能是你的Action类没有继承structs里面的DispatchAction或者其它的类。还有你注意下方法的参数列表,类型顺序要正确才行,是按照以下顺序的:ActionMapping mapping,ActionForm f......
答案就在这里:struts的java.lang.NoSuchMethodException异常处理

解决方案二:

这个已经看过了,请求方式是get,当url后拼接参数来请求的时候会报找不到方法异常,去掉参数后就不会报异常

解决方案三:

添加你传递的字段的对应的set,get方法

解决方案四:

根据你的配置,应该com.wlt.webm.business.action.NetPayAction类中有这个ZXBack方法才对。
检查下是不是有这个方法呢?

时间: 2024-11-17 00:41:04

参数-struts处理请求,异常:java.lang.NoSuchMethodException的相关文章

struts2异常java.lang.NoSuchMethodException: com.struts.action.UserAction.create()

问题描述 原来用的struts2.0版本,运行项目没有问题.后来换了struts2.2.1版本后,只要访问Action,都会出现java.lang.NoSuchMethodException: com.struts.action.UserAction.create()类似的错误,就是说Action中找不到create这个方法.struts.xml<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE stru

没有方法异常-做ssh项目报java.lang.NoSuchMethodException

问题描述 做ssh项目报java.lang.NoSuchMethodException type Exception report message com.action.LoginAction.Login() description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.NoSuchMethodException: c

springmvc 实现文件下载 出现异常java.lang.OutOfMemoryError: Java heap space

问题描述 springmvc 实现文件下载 出现异常java.lang.OutOfMemoryError: Java heap space 网上找解决方案,一般都是tomcat中添加-Xms256m -Xms512m等配置,但是不行啊. 我的是MyEclipse里的tomcat. 下载20M(包括)以内的文件没问题,超过就会报异常,有什么解决办法吗? 还有是不是请求下载文件时,服务器会把文件全部装入内存再发过来,还是分成多个部分发送,超过内存大小的文件如何发送呢? ** --异常信息 ** ty

struts-求助java.lang.NoSuchMethodException

问题描述 求助java.lang.NoSuchMethodException at java.lang.Class.getMethod(Class.java:1605) at com.zfsoft.struts.action.BaseAction.execute(BaseAction.java:65) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at or

Android异常 java.lang.IllegalStateException解决方法_Android

Android异常详情介绍 这种异常我遇到以下两种情况: 1. java.lang.IllegalStateException: No wrapped connection. 2.java.lang.IllegalStateException: Adapter is detached. 原因: 1.单线程一次执行一个请求可以正常执行,如果使用多线程,同时执行多个请求时就会出现连接超时. 2.HttpConnection没有连接池的概念,多少次请求就会建立多少个IO,在访问量巨大的情况下服务器的I

java.lang.NoSuchMethodException: com.sun.proxy.$Proxy58.list错误解决办法_java

java.lang.NoSuchMethodException: com.sun.proxy.$Proxy58.list错误解决办法 玩web的SSH总会有些令你意想不到的exception,这里其中有很多事自己不小心,或者马虎所造成.因此,解决的方案会各有不同,别人出现的异常解决方案对你的可能无效,就像上面的我报的异常一样,百度了很多很多次,给我的答案无非就是在aop上加上一句,但是非常抱歉,我加上去无效!所以还是那句话,对于自己的异常,还是要自己解决. 首先说明一下,我这次的练习的ssh结构

登录不成功-java.lang.NoSuchMethodException: com.crm.action.UserAction.login()

问题描述 java.lang.NoSuchMethodException: com.crm.action.UserAction.login() 三大框架登录时老是说没找到com.crm.action.UserAction.login()

找不到方法-structs2 java.lang.NoSuchMethodException怎么解决?

问题描述 structs2 java.lang.NoSuchMethodException怎么解决? 理论上userPre和evaluation1Pre应该除了具体实现没有其他差别,但是在实际运行过程中,evaluation1Pre可以正常运行,而userPre就会报java.lang.NoSuchMethodException: form.userPreAction.execute()的错误,实在是找不到为什么,跪求各路大神帮解决.(真的没有C币了,见谅...) 解决方案 java.lang.

java.lang.NoSuchMethodException: x.getHibernateLazyInitializer()

使用struts2 对Java 对象进行序列化时报错: Xml代码   java.lang.NoSuchMethodException: com.entity.message.push.OSMessage.getHibernateLazyInitializer()   at java.lang.Class.getMethod(Class.java:1607)       at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWrit