my dog learned polymorphism*
The moose likes Java in General and the fly likes why i m getting this exception java.lang.NoSuchMethodError ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "why i m getting this exception java.lang.NoSuchMethodError ?" Watch "why i m getting this exception java.lang.NoSuchMethodError ?" New topic
Author

why i m getting this exception java.lang.NoSuchMethodError ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

after i have configured nb to work with tomcat
i m getting this exception when ever i start IDE, its like a small error icon at the bottom of netbeans and when i click on that icon it shows this exception
message,

and it start behaving abnormal like after creating new webapp project and when you click on finish after entering data
the frame doesnt close and application doesnt open in the project window
and when i run the index.jsp file it throws an exception like


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14432
    
  23

This sounds like a version error, for example you've compiled your code with a newer version of the JSP and servlet library than what your Tomcat supports.

With javax.servlet version are you using, and which version of Tomcat? Are you sure that the Tomcat version you're using supports that version of the javax.servlet library?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

That method was added in version 3.0 of the servlet specification. You will need to update both your libraries and your web container to a version that supports version 3.0 if you want to be able to use the method.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Rob Spoor wrote:That method was added in version 3.0 of the servlet specification. You will need to update both your libraries and your web container to a version that supports version 3.0 if you want to be able to use the method.

but i have downloaded the lastest tomcat zip file last night
and i m using nb 7
i guess this two are the latest versions aren't they ?
can you guys help me, for what i need to do to fix this
thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

Tomcat 6 is definitely not the latest version. Tomcat 7 has been past the beta stages since early 2011. The current version is already 7.0.23.
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Rob Spoor wrote:Tomcat 6 is definitely not the latest version. Tomcat 7 has been past the beta stages since early 2011. The current version is already 7.0.23.

one more thing i need to tell you rob is that when i create new project in nb then only this problem arises
i have some example codes from a book called murach's jsp and servlet that code is working fine without any error message.
do you think upgrading to new version of tomcat will solve my problem ?
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Rob Spoor wrote:That method was added in version 3.0 of the servlet specification. You will need to update both your libraries and your web container to a version that supports version 3.0 if you want to be able to use the method.

hi again rob , soory if i m troubling you by showing a big error messages and all
i have installed the tomcat 7 but now i m getting this error while i m trying to run any one project from murach books of jsp and servlets

note: this example is a working example, i have tried earlier
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

You should read http://tomcat.apache.org/migration.html#Migrating_from_6.0.x_to_7.0.x.
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692


ok just tell me about this error of tomcat 7 taken from log file of tomcat
this happens when tomcat was starting (it appears every time i start tomcat )


one strange thing i have notice now is that i have 2 tomcat one preinstalled with netbeans and one is zip which i use now , i have point my project folder to sue the current tomcat 7 but when i run my project i see in the servers tab ,that both the tomcat is running one of the version 1.6.something and one is 7 is that a cause of error ?

if yes than i need to uninstall netbeans and then reinstall with no tomcat and glashfish servers because just removing it from the netbeans will not uninstall the product
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why i m getting this exception java.lang.NoSuchMethodError ?