code: public void printStackTrace(java.io.PrintStream s)
    {
  
      if (s == null)
        s = System.err;
  
      try
      {
        super.printStackTrace(s);
      }
      catch (Exception e){}
  
      Throwable exception = m_exception;
  
      for (int i = 0; (i < 10) && (null != exception); i++)
      {
        s.println("---------");
        exception.printStackTrace(s);
  
        if (exception instanceof TransformerException)
        {
          TransformerException se = (TransformerException) exception;
          Throwable prev = exception;
  
          exception = se.getException();
  
          if (prev == exception)
            break;
        }
        else
        {
          exception = null;
        }
      }
    }
docs: Print the the trace of methods from where the error
  originated.  This will trace all nested exception
  objects, as well as this object.
  @param s The stream where the dump will be sent to.