Handler处理失败;嵌套异常是 java.lang.NoSuchMethodError
Handler processing failed; nested exception is java.lang.NoSuchMethodError
我运行本地没有bug,但是我发布到服务器上出现错误Handler processing failed;嵌套异常是 java.lang.NoSuchMethodError.This 是我 company.Used 中的旧项目 spring+hibernate+struts2.This bug 让我困惑了 2 周这是服务器 Excption:
<html><head><title>Apache Tomcat/5.5.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: com.golden.ex.bs.app.menber.dao.MenberDao.getComp(Ljava/lang/String;)Ljava/util/List;
org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1259)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.golden.ex.framework.core.filter.FlashFilter.doFilterInternal(FlashFilter.java:30)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
com.golden.ex.framework.core.filter.LoggerMDCFilter.doFilterInternal(LoggerMDCFilter.java:43)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>root cause</b> <pre>java.lang.NoSuchMethodError: com.golden.ex.bs.app.menber.dao.MenberDao.getComp(Ljava/lang/String;)Ljava/util/List;
com.restful.CompService.getCompRemote(CompService.java:39)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.golden.ex.framework.core.filter.FlashFilter.doFilterInternal(FlashFilter.java:30)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
com.golden.ex.framework.core.filter.LoggerMDCFilter.doFilterInternal(LoggerMDCFilter.java:43)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.20</h3></body></html>
控制器:
package com.restful;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.golden.ex.bs.app.menber.dao.MenberDao;
import com.golden.ex.bs.app.menber.service.MbOptService;
@Controller
@RequestMapping("/CompService")
public class CompService
{
@Autowired
private MbOptService mboptService;
@Autowired
private MenberDao menberDao;
@ResponseBody
@RequestMapping(value = "/getCompRemote" ,produces = {"text/html;charset=UTF-8"})
public String getCompRemote(@RequestParam("company") String test)
{
String comp=test;
System.out.println("=============进入接口==========");
String company=comp;
List<Map> menber =this.menberDao.getComp(company);
if(menber==null||menber.equals(""))
{
return ApiResponse.buildSuccessResponse(201,"不存在公司",menber);
}
else
{
return ApiResponse.buildSuccessResponse(200,"成功",menber);
}
}
@ResponseBody
@RequestMapping(value = "/joinCompRemote" ,produces = {"text/html;charset=UTF-8"})
public String joinCompRemote(@RequestParam("company") String company,@RequestParam("userid") String userid)
{
System.out.println("=============进入接口==========");
boolean check=this.mboptService.checkJoinUser(userid);
if(check==true)
{
//修改,更新optemp公司代码 status 0未审核 1通过 2未通过
this.mboptService.joinUpdate(userid,company);
}
else
{
//新增,增加一笔
this.mboptService.joinInsert(userid,company);
}
return ApiResponse.buildSuccessResponse(200,"您的审核已提交,等待该公司确认");
}
}
道:
public List<Map> getComp(String company)
{
String sql="select HYDM,MBNAME from BS_MENBER where MBNAME like '%"+company+"%'";
List<Map> bs=this.listSQL(sql);
return bs;
}
相关问题我都查过了,大部分都不符合我的情况,我的IDE是myeclipse 6.0,jboss4.0.5GA
谢谢
我认为您的服务器上的 MemberDao
class 版本与本地版本不同。检查您的 JBoss 容器,当您部署应用程序时,包含“MemberDao.java
”的打包 jar 被覆盖。也许您将“compservice.jar
”部署到容器的全局 lib 文件夹中。
我运行本地没有bug,但是我发布到服务器上出现错误Handler processing failed;嵌套异常是 java.lang.NoSuchMethodError.This 是我 company.Used 中的旧项目 spring+hibernate+struts2.This bug 让我困惑了 2 周这是服务器 Excption:
<html><head><title>Apache Tomcat/5.5.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: com.golden.ex.bs.app.menber.dao.MenberDao.getComp(Ljava/lang/String;)Ljava/util/List;
org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1259)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.golden.ex.framework.core.filter.FlashFilter.doFilterInternal(FlashFilter.java:30)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
com.golden.ex.framework.core.filter.LoggerMDCFilter.doFilterInternal(LoggerMDCFilter.java:43)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>root cause</b> <pre>java.lang.NoSuchMethodError: com.golden.ex.bs.app.menber.dao.MenberDao.getComp(Ljava/lang/String;)Ljava/util/List;
com.restful.CompService.getCompRemote(CompService.java:39)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.golden.ex.framework.core.filter.FlashFilter.doFilterInternal(FlashFilter.java:30)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
com.golden.ex.framework.core.filter.LoggerMDCFilter.doFilterInternal(LoggerMDCFilter.java:43)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.20</h3></body></html>
控制器:
package com.restful;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.golden.ex.bs.app.menber.dao.MenberDao;
import com.golden.ex.bs.app.menber.service.MbOptService;
@Controller
@RequestMapping("/CompService")
public class CompService
{
@Autowired
private MbOptService mboptService;
@Autowired
private MenberDao menberDao;
@ResponseBody
@RequestMapping(value = "/getCompRemote" ,produces = {"text/html;charset=UTF-8"})
public String getCompRemote(@RequestParam("company") String test)
{
String comp=test;
System.out.println("=============进入接口==========");
String company=comp;
List<Map> menber =this.menberDao.getComp(company);
if(menber==null||menber.equals(""))
{
return ApiResponse.buildSuccessResponse(201,"不存在公司",menber);
}
else
{
return ApiResponse.buildSuccessResponse(200,"成功",menber);
}
}
@ResponseBody
@RequestMapping(value = "/joinCompRemote" ,produces = {"text/html;charset=UTF-8"})
public String joinCompRemote(@RequestParam("company") String company,@RequestParam("userid") String userid)
{
System.out.println("=============进入接口==========");
boolean check=this.mboptService.checkJoinUser(userid);
if(check==true)
{
//修改,更新optemp公司代码 status 0未审核 1通过 2未通过
this.mboptService.joinUpdate(userid,company);
}
else
{
//新增,增加一笔
this.mboptService.joinInsert(userid,company);
}
return ApiResponse.buildSuccessResponse(200,"您的审核已提交,等待该公司确认");
}
}
道:
public List<Map> getComp(String company)
{
String sql="select HYDM,MBNAME from BS_MENBER where MBNAME like '%"+company+"%'";
List<Map> bs=this.listSQL(sql);
return bs;
}
相关问题我都查过了,大部分都不符合我的情况,我的IDE是myeclipse 6.0,jboss4.0.5GA 谢谢
我认为您的服务器上的 MemberDao
class 版本与本地版本不同。检查您的 JBoss 容器,当您部署应用程序时,包含“MemberDao.java
”的打包 jar 被覆盖。也许您将“compservice.jar
”部署到容器的全局 lib 文件夹中。