apache/hadoop · error · ResourceEstimatorException

Class: {} not instance of {}

Error message

Class: {} not instance of {}

What it means

Error "Class: {} not instance of {}" thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-resourceestimator/src/main/java/org/apache/hadoop/resourceestimator/common/config/ResourceEstimatorUtil.java:67

  @SuppressWarnings("unchecked") public static <T> T createProviderInstance(
      Configuration conf, String configuredClassName, String defaultValue,
      Class<T> type) throws ResourceEstimatorException {
    String className = conf.get(configuredClassName);
    if (className == null) {
      className = defaultValue;
    }
    try {
      Class<?> concreteClass = Class.forName(className);
      if (type.isAssignableFrom(concreteClass)) {
        Constructor<T> meth =
            (Constructor<T>) concreteClass.getDeclaredConstructor(EMPTY_ARRAY);
        meth.setAccessible(true);
        return meth.newInstance();
      } else {
        StringBuilder errMsg = new StringBuilder();
        errMsg.append("Class: ").append(className).append(" not instance of ")
            .append(type.getCanonicalName());
        throw new ResourceEstimatorException(errMsg.toString());
      }
    } catch (ClassNotFoundException e) {
      StringBuilder errMsg = new StringBuilder();
      errMsg.append("Could not instantiate : ").append(className)
          .append(" due to exception: ").append(e.getCause());
      throw new ResourceEstimatorException(errMsg.toString());
    } catch (ReflectiveOperationException e) {
      StringBuilder errMsg = new StringBuilder();
      errMsg.append("Could not instantiate : ").append(className)
          .append(" due to exception: ").append(e.getCause());
      throw new ResourceEstimatorException(errMsg.toString());
    }
  }
}

View on GitHub (pinned to 2add963021)

Solutions

  1. Configure a class that actually implements/extends the expected interface for this resource estimator setting.

When it happens

Trigger: A class configured in the resource estimator configuration does not implement the expected interface/superclass, so it cannot be used as the configured component.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/1b73b1e4dd2e5933. Report an issue: GitHub.