public Object execute(String methodName, Vector params) throws Exception
    {
        

        Method method = null;

        try
        {
        	List<Method> methods = Arrays.asList(targetClass.getMethods());
			for (Method m : methods) {
				if (m.getName().equals(methodName)){
					method = m;
					break;
				}
			}			
        	
        } catch (SecurityException e) {
        	throw new XmlRpcException(0,"Method " + methodName + " not found in class " + targetClass.getCanonicalName());
		}

        if (method.getDeclaringClass() == Object.class)
        {
            throw new XmlRpcException(0, "Invoker can't call methods defined in java.lang.Object");
        }

        // invoke
        Object returnValue = null;
        try
        {
            returnValue = method.invoke(invokeTarget, params.toArray());
        }
        catch(IllegalAccessException iacc_e)
        {
            throw iacc_e;
        }
        catch(IllegalArgumentException iarg_e)
        {
            throw iarg_e;
        }
        catch(InvocationTargetException it_e)
        {
            logger.error(it_e.getTargetException().getMessage());
            
            // check whether the thrown exception is XmlRpcException
            Throwable t = it_e.getTargetException();
            if (t instanceof XmlRpcException)
            {
                throw (XmlRpcException) t;
            }
            // It is some other exception
            throw new Exception(t.toString());
        }
        return returnValue;
    }