• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with method invoke(object, object)  RSS feed

 
Rafael Fagundes
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off all, hello froma a new user.
Well, in a jsp page i�m trying to use the method invoke from method class:

//...
Object[] args= new Object[] {" "};
//...
solicitacao = session.getAttribute("solti");//ok
classe = solicitacao.getClass(); //ok
metodo = classe.getMethods()[getIndDadosSol(classe.getMethods())];//ok
System.out.println("calsse:"+classe);//ok
System.out.println("metodo:"+metodo);//ok
System.out.println("ele:"+metodo.invoke(metodo,args));//error

//... bean method
public void getDadosSolicitante(String solicitante[])throws SQLException

And the result is:
Error: java.lang.IllegalArgumentException: object in not an instance of declaring class

I�m not understanding what is the problem with my code.... Somebody can tell me what's wrong...
Thank�s for your attention,
Rafael.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rafael Castro Fagundes:

...
solicitacao = session.getAttribute("solti");//ok
classe = solicitacao.getClass(); //ok
metodo = classe.getMethods()[getIndDadosSol(classe.getMethods())];//ok
...
System.out.println("ele:"+metodo.invoke(metodo,args));//error

Rafael.



Try metodo.invoke(slicitacao,args)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!