private IOException instantiateException(Class<? extends IOException> cls) throws Exception {
    Constructor<? extends IOException> cn = cls.getConstructor(String.class);
    cn.setAccessible(true);
    IOException ex = cn.newInstance(this.getMessage());
    ex.initCause(this);

    if (ex instanceof HBaseServerException) {
      // this is a newly constructed exception.
      // if an exception defaults to meaning isServerOverloaded, we use that.
      // otherwise, see if the remote exception value should mean setting to true.
      HBaseServerException serverException = (HBaseServerException) ex;
      if (serverOverloaded && !serverException.isServerOverloaded()) {
        serverException.setServerOverloaded(true);
      }
    }

    return ex;
  }
Dynamic class loader to load filter/comparators
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RemoteWithExtrasException.java