当前位置: 代码迷 >> J2EE >> 结果就报错了:java.lang.NoSuchMethodException: com.asiainfo.esop.
  详细解决方案

结果就报错了:java.lang.NoSuchMethodException: com.asiainfo.esop.

热度:486   发布时间:2016-04-22 02:53:12.0
半路出家,空中楼阁啊。。。菜鸟请教Servelet的问题
下面是我在action里写的一个方法,本来只有request参数的,后来因为一个查询报错(在本地windows环境是好的,在unix服务器上出了问题,我怀疑是unix上没有安装中文字符集的问题,因为查询结果中有中文,并且直接对中文进行了处理,不是直接输出。) 我加了response参数。  



  public IRmInvDetailValue[] qryInvDetail(HttpServletRequest request,HttpServletResponse response){

IRmInvDetailSV service = null;
IRmInvDetailValue[] details = null;

//获得当前系统的登录用户的组织ID
long organize_id = SessionManager.getUser().getOrgId();
try{

//获得参数--查询条件
int pid = Integer.parseInt(HttpUtil.getParameter(request, "prod_id"));
int statid = Integer.parseInt(HttpUtil.getParameter(request, "status_cd_id"));
//int fstatid = Integer.parseInt(HttpUtil.getParameter(request, "f_status_id"));
int invid = Integer.parseInt(HttpUtil.getParameter(request, "inv_id"));
int classId = Integer.parseInt(HttpUtil.getParameter(request, "classId"));
request.setCharacterEncoding("GBK");
response.setContentType("text/html;charset=GBK");
service = (IRmInvDetailSV) ServiceFactory.getService(IRmInvDetailSV.class);
details = service.qryInvDetail(pid, statid, invid, classId, organize_id);
}catch(Exception e){
rm_log.error(e.getMessage());
throw new RmExceptionUtil("库存明细查询有错误!");
}
return details;
}


结果就报错了:java.lang.NoSuchMethodException: com.asiainfo.esop.rm.web.RmInvDetailAction.qryInvDetail(javax.servlet.http.HttpServletRequest)。。。

没有这个方法,为啥非要去找只带request的那个方法呢?加了response为啥不行。。。



------解决方案--------------------
确定编译过了吗?
------解决方案--------------------
如楼上所说,你是不是只是改了后面方法里面的参数,而没有改前面调用处的参数。。

很怀疑你的编译是通过了的,,好好查查呗。。

要么,你把你的工程刷新一下,看看会不会编译出错。或者重新编译一下你的工程。
  相关解决方案