private synchronized void writeObject(final ObjectOutputStream out) throws IOException {
    final Object resolvedObj = getResolvedObj();
    if (isSerializable(resolvedObj)) {
      out.defaultWriteObject();
    } else {
      final NamingException namingException = (NamingException) getCause();
      namingException.setResolvedObj(null);
      try {
        out.defaultWriteObject();
      } finally {
        namingException.setResolvedObj(resolvedObj);
      }
    }
  }
Returns {@link NamingException#getResolvedObj()} if the {@code cause} is a
{@code NamingException}. Returns <tt>null</tt> for any other type of {@code cause}.

@return {@code NamingException#getResolvedObj()} if the {@code cause} is a
        {@code NamingException}.
geode-core/src/main/java/org/apache/geode/security/GemFireSecurityException.java