{"record":{"id":"5e58dfdb3554cdf8","repo":"apache/hadoop","slug":"s-constructor-exception-a-class-specified-in-s","errorCode":null,"errorMessage":"%s constructor exception.  A class specified in %s must provide an accessible constructor accepting URI and Configuration, or an accessible default constructor.","messagePattern":"(.+?) constructor exception\\.  A class specified in (.+?) must provide an accessible constructor accepting URI and Configuration, or an accessible default constructor\\.","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":132,"sourceCode":"              AliyunOSSFileSystem.class);\n      credentials = new AliyunCredentialsProvider(newConf);\n    } else {\n      try {\n        LOG.debug(\"Credential provider class is:\" + className);\n        Class<?> credClass = Class.forName(className);\n        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 \"\"","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSUtils.java#L114-L150","documentation":"Error \"%s constructor exception.  A class specified in %s must provide an accessible constructor accepting URI and Configuration, or an accessible default constructor.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSUtils.java:132 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a class with an accessible constructor accepting (URI, Configuration) or an accessible default constructor, as required by the configuration key."],"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"}