{"record":{"id":"b421826bdaa863f2","repo":"apache/hadoop","slug":"failed-to-initialize-customtokenproviderclass","errorCode":null,"errorMessage":"Failed to initialize {customTokenProviderClass}","messagePattern":"Failed to initialize (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java","lineNumber":1591,"sourceCode":"        throw new TokenAccessProviderException(\"Unable to load OAuth token provider class.\", e);\n      }\n\n    } else if (authType == AuthType.Custom) {\n      try {\n        String configKey = FS_AZURE_ACCOUNT_TOKEN_PROVIDER_TYPE_PROPERTY_NAME;\n\n        Class<? extends CustomTokenProviderAdaptee> customTokenProviderClass\n            = getTokenProviderClass(authType, configKey, null,\n            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  /**","sourceCodeStart":1573,"sourceCodeEnd":1609,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java#L1573-L1609","documentation":"Error \"Failed to initialize {customTokenProviderClass}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java:1591 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the custom token provider class is public, instantiable, and on the classpath; check 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-22T20:17:22.307Z"}