code: public Name getResolvedName() {
          if (getCause() instanceof javax.naming.NamingException) {
              return ((javax.naming.NamingException) getCause())
                      .getResolvedName();
          }
          return null;
      }
docs: Convenience method to get the leading portion of the resolved name
  associated with this exception, if the root cause was an instance of
  {@link javax.naming.NamingException}.
  
  @return a composite name describing the the leading portion of the name
  that was resolved successfully if the root cause is an instance
  of javax.naming.NamingException, or <code>null</code> if the
  resolved name field has not been set