{"record":{"id":"0356450346c6d317","repo":"apache/hadoop","slug":"failed-to-load-s-please-check-configuration-hado","errorCode":null,"errorMessage":"Failed to load %s, please check configuration hadoop.kms.audit.logger","messagePattern":"Failed to load (.+?), please check configuration hadoop\\.kms\\.audit\\.logger","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSAudit.java","lineNumber":135,"sourceCode":"   */\n  private Set<Class<? extends KMSAuditLogger>> getAuditLoggerClasses(\n      final Configuration conf) {\n    Set<Class<? extends KMSAuditLogger>> result = new HashSet<>();\n    // getTrimmedStringCollection will remove duplicates.\n    Collection<String> classes =\n        conf.getTrimmedStringCollection(KMSConfiguration.KMS_AUDIT_LOGGER_KEY);\n    if (classes.isEmpty()) {\n      LOG.info(\"No audit logger configured, using default.\");\n      result.add(SimpleKMSAuditLogger.class);\n      return result;\n    }\n\n    for (String c : classes) {\n      try {\n        Class<?> cls = conf.getClassByName(c);\n        result.add(cls.asSubclass(KMSAuditLogger.class));\n      } catch (ClassNotFoundException cnfe) {\n        throw new RuntimeException(\"Failed to load \" + c + \", please check \"\n            + \"configuration \" + KMSConfiguration.KMS_AUDIT_LOGGER_KEY, cnfe);\n      }\n    }\n    return result;\n  }\n\n  /**\n   * Create a collection of KMSAuditLoggers from configuration, and initialize\n   * them. If any logger failed to be created or initialized, a RunTimeException\n   * is thrown.\n   */\n  private void initializeAuditLoggers(Configuration conf) {\n    Set<Class<? extends KMSAuditLogger>> classes = getAuditLoggerClasses(conf);\n    Preconditions\n        .checkState(!classes.isEmpty(), \"Should have at least 1 audit logger.\");\n    for (Class<? extends KMSAuditLogger> c : classes) {\n      final KMSAuditLogger logger = ReflectionUtils.newInstance(c, conf);\n      auditLoggers.add(logger);","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSAudit.java#L117-L153","documentation":"KMS builds its audit logger list from the kms-site.xml property hadoop.kms.audit.logger (KMSConfiguration.KMS_AUDIT_LOGGER_KEY), a list of class names implementing KMSAuditLogger. In getAuditLoggerClasses (KMSAudit.java:135), if Configuration.getClassByName throws ClassNotFoundException for one of the names, KMS wraps it in a RuntimeException 'Failed to load <class>, please check configuration hadoop.kms.audit.logger' during webapp initialization, which prevents the KMS from starting.","triggerScenarios":"Setting hadoop.kms.audit.logger to a class that is not on the KMS classpath or is misspelled — e.g. 'org.apache.hadoop.crypto.key.kms.server.SimpleKMSAuditLogger' typo'd, or a custom audit logger class whose jar was not dropped into the KMS webapp/classpath. Leaving the property empty is safe (SimpleKMSAuditLogger is used).","commonSituations":"Deploying a custom audit logger and forgetting to install its jar; fully-qualified class name typos; class moved/renamed between Hadoop versions; copy-pasting audit logger config from a different product layout (class exists in HDFS but not hadoop-kms).","solutions":["Check the kms-site.xml value of hadoop.kms.audit.logger for typos in the fully-qualified class names","If the logger is a custom class, install its jar (and deps) into the KMS classpath (e.g. share/hadoop/kms/webapp/WEB-INF/lib or the KMS lib dir) and restart","If you do not need a custom logger, remove the property entirely to fall back to SimpleKMSAuditLogger","Verify the class implements KMSAuditLogger (it is loaded with asSubclass(KMSAuditLogger.class))"],"exampleFix":"<!-- before -->\n<property><name>hadoop.kms.audit.logger</name>\n  <value>com.mycompany.KmsAuditLogger</value></property>\n<!-- after: jar installed, or drop back to default -->\n<property><name>hadoop.kms.audit.logger</name>\n  <value>org.apache.hadoop.crypto.key.kms.server.SimpleKMSAuditLogger</value></property>","handlingStrategy":"validation","validationCode":"// Pre-flight before enabling a custom audit logger\nString cls = \"com.mycompany.KmsAuditLogger\";\ntry { Class<?> c = Class.forName(cls);\n  Preconditions.checkArgument(KMSAuditLogger.class.isAssignableFrom(c)); }\ncatch (ClassNotFoundException e) { /* install the jar before configuring */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Deploy custom logger jars to the KMS webapp lib directory before enabling the config","Test logger class names by fully-qualified spelling in a staging KMS first","Keep hadoop.kms.audit.logger unset unless a custom logger is truly required"],"tags":["hadoop-kms","configuration","class-not-found","audit","startup-failure"],"backgroundTag":"plugin-class-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}