e.printStackTrace();
  public Object callJava (Object object, String method, Object[] args,                           Object methodKey, ExpressionContext exprContext)     throws SAXException  {    // if the function name has a "." in it, then its a static    // call with the args being arguments to the call. If it     // does not, then its a method call on args[0] with the rest    // of the args as the arguments to the call    int dotPos = method.lastIndexOf (".");    Object[] methodArgs = null;    boolean isNew = false;    if (dotPos == -1)     {      methodArgs = args;      object = args[0];      if (args.length > 1)       {        methodArgs = new Object[args.length-1];        System.arraycopy (args, 1, methodArgs, 0, args.length - 1);      }      else        methodArgs = null;    }    else     {      String className = method.substring (0, dotPos);      method = method.substring (dotPos+1);      methodArgs = args;      isNew = method.equals ("new");      try       {        if(null == object)          object = Class.forName (className);      }      catch (ClassNotFoundException e)       {        // throw new BSFException(1, "unable to load class '" +         //  className + "'", e);        throw new SAXException(e);      }    }      Object[][] convertedArgs = new Object[1][];    if((null != m_cachedMethods) && !isNew && (null != object))    {      try      {        Method thisMethod = (Method)m_cachedMethods.get(methodKey);        if(null != thisMethod)        {          Class[] paramTypes = thisMethod.getParameterTypes();          MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext);                               return thisMethod.invoke (object, convertedArgs[0]);        }      }      catch(Exception e)      {        // try again below...      }        }    // try to find the method and run it, taking into account the special    // type conversions we want.    try     {      if (isNew)       {        // if its a "new" call then need to find and invoke a constructor        // otherwise find and invoke the appropriate method. The method        // searching logic is the same of course.        Constructor c = MethodResolver.getConstructor((Class) object,                                                       methodArgs, convertedArgs,                                                      exprContext);        Object obj = c.newInstance (convertedArgs[0]);        return obj;      }      else       {        Class cl = (object instanceof Class) ? ((Class)object) : object.getClass();        Method m = MethodResolver.getMethod(cl, method,                                            methodArgs,                                             convertedArgs, exprContext);        Object returnObj = m.invoke (object, convertedArgs[0]);        if(!isNew)        {          if(null == m_cachedMethods)            m_cachedMethods = new Hashtable();          m_cachedMethods.put(methodKey, m);        }        return returnObj;      }    }    catch (NoSuchMethodException nsme)     {      throw new SAXException(nsme);      // throw new BSFException (BSFException.REASON_OTHER_ERROR,      //  "NoSuchMethodException: " + nsme);    }    catch (Exception e)     {      throw new SAXException(e);      /*      Throwable t = (e instanceof InvocationTargetException) ?                    ((InvocationTargetException)e).getTargetException () :                    null;      throw new BSFException (BSFException.REASON_OTHER_ERROR,        "method call/new failed: " + e +        ((t==null)?"":(" target exception: "+t)), t);      */    }    // should not get here    // return null;  }