• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.reflect.Method, method.invoke(...) problem  RSS feed

 
Rohit Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is regarding , java.lang.reflect.Method

I am calling,

method.invoke(this, obj1, index);
where obj1 is a object of a class, and index is Integer.

But i am getting ,
java.lang.IllegalArgumentException: argument type mismatch Exception.

I have proper method with signature in same calss ie. method with exact name, and exact arguments.

But if I call them with single argument, like either obj1 or index (with proper method with signature) then it works fine.

What would be the reason.

Is it because of 2 arguments?


Thanks in advance.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the signature of the method you are trying to call this way?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!