| 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: 24059
|
|
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
Bartender
Joined: Aug 16, 2005
Posts: 12929
|
|
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: 24059
|
|
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.
|
 |
 |
|
|
subject: InvocationTargetException java.lang.NoSuchMethodError
|
|
|