[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What r the causes of java.lang.NoSuchMethodError?

Posted on 2005-04-20
16
Medium Priority
?
378 Views
Last Modified: 2010-05-18
I'm getting the following error message for last two hours and what drives me nuts is that it was working fine just a few minutes before that.
The method is in the java file and the class file is int the right directory.
Any advice plz?

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: com.near.region.RegionalManager.DblCheck(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
      at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:498)
      at org.apache.jsp.overview_proc_jsp._jspService(overview_proc_jsp.java:116)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:536)


root cause

java.lang.NoSuchMethodError: com.near.region.RegionalManager.DblCheck(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
      at org.apache.jsp.overview_proc_jsp._jspService(overview_proc_jsp.java:98)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:536)



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

Apache Tomcat/4.1.31
0
Comment
Question by:nagunpyo
  • 8
  • 7
16 Comments
 

Author Comment

by:nagunpyo
ID: 13825627
i've deleted the old class and recompiled the java code, but still no luck.
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13825681
Do you have DblCheck method in RegionalManager?

after changing the class files you recompile and redploy as well.

Post your JSP
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13825702
Did you change the version of the compiler ?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:nagunpyo
ID: 13825706
Yes, I do have the method in RegionalManager, I did recompile and restart Tomcat.

Here's my JSP file

<%@ page language="java" import="java.io.*" contentType="text/html;charset=UTF-8" %>

<jsp:useBean id="cc" scope="page" class="com.near.region.OverviewCode" />
<jsp:useBean id="cm" scope="page" class="com.near.region.RegionalManager" />
<jsp:useBean id="uf" scope="page" class="com.near.code.UtilFunc" />
<%
try{
      
      String tName = uf.toKor(request.getParameter("tName"));            //---- Table name
      String country = uf.toKor(request.getParameter("country"));
      String gov = uf.toKor(request.getParameter("government"));
      String typemain = uf.toKor(request.getParameter("typeMain"));
      String typesub = uf.toKor(request.getParameter("typeSub"));
      String lang = uf.toKor(request.getParameter("LAN"));

      int IDX = cm.DblCheck(tName, country, gov, typemain, typesub, lang);
      if(IDX > 0)
      {
            response.sendRedirect("overview_modify.jsp?TOVIEW_IDX=" + IDX);
      }else{
            response.sendRedirect("overview_write.jsp?tName=" + tName + "&country=" + country + "&government=" + gov + "&typeMain=" + typemain + "&typeSub=" + typesub + "&LAN=" + lang);
      }

}catch(Exception e){
      out.println(e);
}

%>
0
 

Author Comment

by:nagunpyo
ID: 13825716
I did not change the version of the compiler
0
 

Author Comment

by:nagunpyo
ID: 13825753
I tried renaming the method in question and the error message was different.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 5 in the jsp file: /admin/region/overview_proc.jsp

Generated servlet error:
    [javac] Compiling 1 source file

/usr1/projects/tomcat4.1.31-near/work/Standalone/203.233.205.19/app/admin/region/overview_proc_jsp.java:98: cannot resolve symbol
symbol  : method DoubleChechk (java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
location: class com.near.region.RegionalManager
      int IDX = cm.DoubleChechk(tName, country, gov, typemain, typesub, lang);
                    ^
1 error


      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:248)
      at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:315)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:328)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:142)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:536)

so, I guess Tomcat does know about the method.
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13825809
This time
i think you have a typo there

>int IDX = cm.DoubleChechk(tName, country, gov, typemain, typesub, lang);
   PLease check the typos in this case other wise you should not get the no element found exception.The name you specified in JSP is different from the name in the java class "RegionalManager".
0
 

Author Comment

by:nagunpyo
ID: 13825851
I did it on purpose to see if Tomcat actually knows about the method.
And since the error message was different when I tried to access a method that doesn't exist, I guess Tomcat did know about the method before and java.lang.NoSuchMethodError does not actually mean the method doesn't exist in the class.
0
 

Author Comment

by:nagunpyo
ID: 13826036
OK... it seems like I can't add any methods into the file anymore.
I added a simple 1-line testing method and tried call it from jsp, the same error message. @_@
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13826041
From javadocs
Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.
Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed

check this
1>Do you have the package statement in yout java file RegionalManager
package com.near.region;

0
 

Author Comment

by:nagunpyo
ID: 13826101
yeah, i do have that statement...
0
 

Author Comment

by:nagunpyo
ID: 13826144
hmm... i deleted the old class file and recompiled it but it seems like i'm keep on getting back the old version.
i mean, when i recompile, i get a new class file but i think the contents of the new class file is actually the old file.
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13826175
ok change the version of JDK ..which version is that?
0
 
LVL 8

Assisted Solution

by:koppcha
koppcha earned 800 total points
ID: 13826177
java -verison will tell you
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 1200 total points
ID: 13828268
most probably you have two versions of java installed on your machine..

you class is being compiled by using some other version and your Tomcat is running using some other version...

I have seen this error and its either getting a stale class file from some where or your java versions are not matching.....

check if you have this class sitting somewhere else as well ( most probably in a jar file under your lib directory)..
and check to be sure that your tomcat and IDE where you are compiling your class are using the same JDK
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13840130
Thanks fo rhte grade
Hope you resolved the issue.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Currently, there is an issue with being able to copy values from an external application to a dropdown list in Project Web Access (PWA).  The standard copy and paste methods don't seem to work properly. Here is a way to accomplish this task to s…
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question