users@glassfish.java.net

Re: Invoke error when using refection to call SLSB business-method

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Wed, 27 May 2009 20:51:51 +0200

glassfish_at_javadesktop.org wrote:
> Hi
>
> We have a library in a seperat JAR-file where we keep some tools and abstract classes.
> In one of those classes that is a superclass to our implementation of a SLSB with common utilitys ie, get a remote reference, do logging
> This JAR is later build into the the EAR-file.
>
> I want to add a call to another SLSB where we do all logging af data to a database.
> I don't want any references from our library to SLSB so I thought of using reflection.
>
> I manage to get a reference to the log-SLSB and get a Method from the EJB-metadata and even succesfully call an no-argument method and a method with a String argument.
> But when I try to pass a class that is developed by ourself, a wrapper around a hashmap, I get an IllegalArgumentException and as a cause "argument type mismatch".
>
> I am shure I pass the right data.
>
> Can this have to do with classloaders ?

The classloader has nothing to do with this. The exception means that
the object you are passing into the method is not of the type the method
is expecting.

What is the expected type/are the expected types when you invoke the
method? That is the types of the classes of the array "pm"?


--
Wolfram Rittmeyer