Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other JSE/JEE APIs and the fly likes InvocationTargetException java.lang.NoSuchMethodError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "InvocationTargetException java.lang.NoSuchMethodError" Watch "InvocationTargetException java.lang.NoSuchMethodError" New topic
Author

InvocationTargetException java.lang.NoSuchMethodError

Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
I am getting this error while executng a method through reflection.

java.lang.reflect.InvocationTargetException: java.lang.NoSuchMethodError

Where as the method is there inthe classs...


ANy other reasons You can think of?

Thanks


Share Knowledge to gain it.
SCJP 2, SCWCD 2, SCDJWS, IBM 141 (In Progress), IBM 486 (Next)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

An InvocationTargetException with a NoSuchMethodError in it suggests a reflective call of a reflective call; sounds like some tricky code here.

But in any case, some method is there. The InvocationTargetException's "getCause()" method will return the NoSuchMethodError object itself; why not start by fetching that object, doing a printStackTrace() on it, and showing us the result. We'll work from there.


[Jess in Action][AskingGoodQuestions]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Where as the method is there inthe classs...

Are you sure? Show us the code where you lookup and call the method, and the class that contains the method. Is the method public?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
Its working now, actually the method name in the exception was misleading.

That method does exists, but its calling a method in a pagebean, which actually is not present, reason being old class files for the pagebean.

Thanks a lot
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Originally posted by Andy Smith:

That method does exists, but its calling a method in a pagebean, which actually is not present, reason being old class files for the pagebean.


Ah, great -- that's what I was anticipating above. Glad you figured it out.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: InvocationTargetException java.lang.NoSuchMethodError
 
Similar Threads
during runtime : java.lang.NoSuchMethodError HELP!
How to get server IP address?
java.lang.NoSuchMethodError !!
destroy() in threads
jsp:useBean question