{"record":{"id":"36e87bc2c1ac61d8","repo":"apache/hadoop","slug":"unable-to-load-custom-token-provider-class-e","errorCode":null,"errorMessage":"Unable to load custom token provider class: {e}","messagePattern":"Unable to load custom token provider class: (.+?)","errorType":"validation","errorClass":"TokenAccessProviderException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java","lineNumber":1600,"sourceCode":"            CustomTokenProviderAdaptee.class);\n\n        if (customTokenProviderClass == null) {\n          throw new IllegalArgumentException(\n                  String.format(\"The configuration value for \\\"%s\\\" is invalid.\", configKey));\n        }\n        CustomTokenProviderAdaptee azureTokenProvider = ReflectionUtils\n                .newInstance(customTokenProviderClass, rawConfig);\n        if (azureTokenProvider == null) {\n          throw new IllegalArgumentException(\"Failed to initialize \" + customTokenProviderClass);\n        }\n        LOG.trace(\"Initializing {}\", customTokenProviderClass.getName());\n        azureTokenProvider.initialize(rawConfig, accountName);\n        LOG.trace(\"{} init complete\", customTokenProviderClass.getName());\n        return new CustomTokenProviderAdapter(azureTokenProvider, getCustomTokenFetchRetryCount());\n      } catch(IllegalArgumentException e) {\n        throw e;\n      } catch (Exception e) {\n        throw new TokenAccessProviderException(\"Unable to load custom token provider class: \" + e, e);\n      }\n\n    } else {\n      throw new TokenAccessProviderException(String.format(\n              \"Invalid auth type: %s is being used, expecting OAuth\", authType));\n    }\n  }\n\n  /**\n   * Returns the SASTokenProvider implementation to be used to generate SAS token.<br>\n   * Users can choose between a custom implementation of {@link SASTokenProvider}\n   * or an in house implementation {@link FixedSASTokenProvider}.<br>\n   * For Custom implementation \"fs.azure.sas.token.provider.type\" needs to be provided.<br>\n   * For Fixed SAS Token use \"fs.azure.sas.fixed.token\" needs to be provided.<br>\n   * In case both are provided, Preference will be given to Custom implementation.<br>\n   * Avoid using a custom tokenProvider implementation just to read the configured\n   * fixed token, as this could create confusion. Also,implementing the SASTokenProvider\n   * requires relying on the raw configurations. It is more stable to depend on","sourceCodeStart":1582,"sourceCodeEnd":1618,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java#L1582-L1618","documentation":"Error \"Unable to load custom token provider class: {e}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java:1600 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the custom token provider class named in configuration is on the classpath and can be loaded."],"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"}