{"record":{"id":"4bb45a655cc06cfc","repo":"apache/hadoop","slug":"classname-instantiation-exception","errorCode":null,"errorMessage":"{className} instantiation exception.","messagePattern":"(.+?) instantiation exception\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSUtils.java","lineNumber":138,"sourceCode":"        try {\n          credentials =\n              (CredentialsProvider)credClass.getDeclaredConstructor(\n                  URI.class, Configuration.class).newInstance(uri, conf);\n        } catch (NoSuchMethodException | SecurityException e) {\n          credentials =\n              (CredentialsProvider)credClass.getDeclaredConstructor()\n              .newInstance();\n        }\n      } catch (ClassNotFoundException e) {\n        throw new IOException(className + \" not found.\", e);\n      } catch (NoSuchMethodException | SecurityException e) {\n        throw new IOException(String.format(\"%s constructor exception.  A \" +\n            \"class specified in %s must provide an accessible constructor \" +\n            \"accepting URI and Configuration, or an accessible default \" +\n            \"constructor.\", className, CREDENTIALS_PROVIDER_KEY),\n            e);\n      } catch (ReflectiveOperationException | IllegalArgumentException e) {\n        throw new IOException(className + \" instantiation exception.\", e);\n      }\n    }\n\n    return credentials;\n  }\n\n  /**\n   * Turns a path (relative or otherwise) into an OSS key, adding a trailing\n   * \"/\" if the path is not the root <i>and</i> does not already have a \"/\"\n   * at the end.\n   *\n   * @param key OSS key or \"\"\n   * @return the with a trailing \"/\", or, if it is the root key, \"\".\n   */\n  public static String maybeAddTrailingSlash(String key) {\n    if (StringUtils.isNotEmpty(key) && !key.endsWith(\"/\")) {\n      return key + '/';\n    } else {","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSUtils.java#L120-L156","documentation":"Error \"{className} instantiation exception.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSUtils.java:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the class named in the configuration can be instantiated (not abstract, accessible constructor); inspect the logged cause."],"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"}