This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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: 24206
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: 24206
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.
 
The only cure for that is hours of television radiation. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic