{"record":{"id":"70223ac396d624e3","repo":"apache/hadoop","slug":"could-not-instantiate-due-to-exception","errorCode":null,"errorMessage":"Could not instantiate : {} due to exception: {}","messagePattern":"Could not instantiate : (.+?) due to exception: (.+?)","errorType":"exception","errorClass":"ResourceEstimatorException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-resourceestimator/src/main/java/org/apache/hadoop/resourceestimator/common/config/ResourceEstimatorUtil.java","lineNumber":73,"sourceCode":"    }\n    try {\n      Class<?> concreteClass = Class.forName(className);\n      if (type.isAssignableFrom(concreteClass)) {\n        Constructor<T> meth =\n            (Constructor<T>) concreteClass.getDeclaredConstructor(EMPTY_ARRAY);\n        meth.setAccessible(true);\n        return meth.newInstance();\n      } else {\n        StringBuilder errMsg = new StringBuilder();\n        errMsg.append(\"Class: \").append(className).append(\" not instance of \")\n            .append(type.getCanonicalName());\n        throw new ResourceEstimatorException(errMsg.toString());\n      }\n    } catch (ClassNotFoundException e) {\n      StringBuilder errMsg = new StringBuilder();\n      errMsg.append(\"Could not instantiate : \").append(className)\n          .append(\" due to exception: \").append(e.getCause());\n      throw new ResourceEstimatorException(errMsg.toString());\n    } catch (ReflectiveOperationException e) {\n      StringBuilder errMsg = new StringBuilder();\n      errMsg.append(\"Could not instantiate : \").append(className)\n          .append(\" due to exception: \").append(e.getCause());\n      throw new ResourceEstimatorException(errMsg.toString());\n    }\n  }\n}\n","sourceCodeStart":55,"sourceCodeEnd":82,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-resourceestimator/src/main/java/org/apache/hadoop/resourceestimator/common/config/ResourceEstimatorUtil.java#L55-L82","documentation":"Error \"Could not instantiate : {} due to exception: {}\" thrown in apache/hadoop.","triggerScenarios":"The resource estimator fails to instantiate a configured class via reflection, e.g. because it has no accessible no-arg constructor or its constructor throws.","commonSituations":"See trigger scenarios.","solutions":["Ensure the configured class has a public no-arg constructor and is on the classpath; see the logged exception for the instantiation failure."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}