当前位置: 代码迷 >> Java Web开发 >> NoSuchMethodError错误,有高手帮小弟我解决吗
  详细解决方案

NoSuchMethodError错误,有高手帮小弟我解决吗

热度:39   发布时间:2016-04-17 15:24:10.0
NoSuchMethodError异常,有高手帮我解决吗
HTTP   Status   500   -  

--------------------------------------------

type   Exception   report

message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

javax.servlet.ServletException:   Servlet   execution   threw   an   exception


root   cause  

java.lang.NoSuchMethodError:   beans.OrderInfo.insertOrder(Ljava/lang/String;FII)Ljava/lang/String;
controller.SubOrderServlet.doPost(SubOrderServlet.java:38)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.5.9   logs.
这个异常到底是什么意思啊,

------解决方案--------------------
可能是还有一个方法doGet没有写吧
------解决方案--------------------
是你用的软件版本不对所致。
------解决方案--------------------
controller.SubOrderServlet.doPost(SubOrderServlet.java:38)
SubOrderServlet是你自己的代码吧。。38行是啥东西哦

------解决方案--------------------
这个问题我在eclipse下经常遇到,一般是由于你新类中新写了方法或建了新类,但新类或新方法没有加载到web服务器中造成了。重启一下就可以了。
------解决方案--------------------
关注!
------解决方案--------------------
java.lang.NoSuchMethodError: beans.OrderInfo.insertOrder(Ljava/lang/String;FII)

查这里beans.OrderInfo有 insertOrder方法嘛?传的参数对不对?
------解决方案--------------------
NoSuchMethodError异常,这个异常说,没有匹配的方法,在doGet(request,response)方法里面调用doPost(request,response),这样只要重写 doPost(request,response) 方法就可以了。因为无论是 get 或 post 请求,都会自动调用doPost(request,response)这个方法了,可以避免 NoSuchMethodError异常了。
代码迷推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.daimami.com/search?q=317
  相关解决方案