• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

InvocationTargetException java.lang.NoSuchMethodError

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Beauty is in the eye of the tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic