You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by er...@airfrance.fr on 2004/04/01 16:29:48 UTC

Problem using beanutils: MethodUtils.invokeMethod throw a null pointer exception




Hi,

I'm using MethodUtils.invokeMethod(Object myObject, String methodName,
Object[] parameters) to do some reflection in my application and I got the
following problem:

I got a null point exception when passing as parameters a table with a null
value inside like this:  [, , null, avionCargoFret, , ]
The following code inside beanutils send me the exception when it does
getClass the null element of the table:

       Class parameterTypes [] = new Class[arguments];
        for (int i = 0; i < arguments; i++) {
            parameterTypes[i] = args[i].getClass();
        }

Is this a misuse of the MethodUtils.invokeMethod?
Is this a known limitation of the implementation?
Is  this a bug?
Is there any solution out there?

Thanks by advance.

Eric


----------------
L'acces immediat aux meilleurs tarifs Air France et au billet electronique
sur http://www.airfrance.com

For immediate access to the best Air France fares and to electronic
tickets, visit our website http://www.airfrance.com

----------------
Les donnees et renseignements contenus dans ce message sont personnels,
confidentiels et secrets. Ce message est adresse a l'individu ou l'entite
dont les coordonnees figurent ci-dessus. Si vous n'etes pas le bon
destinataire, nous vous demandons de ne pas lire, copier, utiliser ou
divulguer cette communication. Nous vous prions de notifier cette erreur a
l'expediteur et d'effacer immediatement cette communication de votre
systeme.
The information contained in this message is privileged, confidential, and
protected from disclosure. This message is intended for the individual or
entity adressed herein. If you are not the intended recipient, please do
not read, copy, use or disclose this communication to others; also please
notify the sender by replying to this message, and then delete it from your
system.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org