{"record":{"id":"ab3122592a5ca4e7","repo":"apache/hadoop","slug":"invalid-class-specified-for","errorCode":null,"errorMessage":"Invalid class specified for {}","messagePattern":"Invalid class specified for (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java","lineNumber":1857,"sourceCode":"    }\n  }\n\n  /**\n   * Retrieve the implementation class for a Journal scheme.\n   * @param conf The configuration to retrieve the information from\n   * @param uriScheme The uri scheme to look up.\n   * @return the class of the journal implementation\n   * @throws IllegalArgumentException if no class is configured for uri\n   */\n  static Class<? extends JournalManager> getJournalClass(Configuration conf,\n                               String uriScheme) {\n    String key\n      = DFSConfigKeys.DFS_NAMENODE_EDITS_PLUGIN_PREFIX + \".\" + uriScheme;\n    Class <? extends JournalManager> clazz = null;\n    try {\n      clazz = conf.getClass(key, null, JournalManager.class);\n    } catch (RuntimeException re) {\n      throw new IllegalArgumentException(\n          \"Invalid class specified for \" + uriScheme, re);\n    }\n      \n    if (clazz == null) {\n      LOG.warn(\"No class configured for \" +uriScheme\n               + \", \" + key + \" is empty\");\n      throw new IllegalArgumentException(\n          \"No class configured for \" + uriScheme);\n    }\n    return clazz;\n  }\n\n  /**\n   * Construct a custom journal manager.\n   * The class to construct is taken from the configuration.\n   * @param uri Uri to construct\n   * @return The constructed journal manager\n   * @throws IllegalArgumentException if no class is configured for uri","sourceCodeStart":1839,"sourceCodeEnd":1875,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1839-L1875","documentation":"FSEditLog.getJournalClass resolves the JournalManager class for a custom edits URI scheme from the config key dfs.namenode.edits.journal-plugin.<scheme>. Configuration.getClass threw a RuntimeException while loading that value, so the NameNode wraps it in IllegalArgumentException('Invalid class specified for <scheme>'). Typical root causes: ClassNotFoundException (class not on the NameNode classpath), a malformed class name, or a class that does not implement JournalManager.","triggerScenarios":"Constructing FSEditLog (NameNode startup) when dfs.namenode.edits.dir or dfs.namenode.shared.edits.dir contains a URI scheme without a built-in handler (not file or qjm) and the matching dfs.namenode.edits.journal-plugin.<scheme> value cannot be loaded as a JournalManager. Thrown from FSEditLog.createJournal at FSEditLog.java:1878.","commonSituations":"Custom third-party journal manager JAR missing from share/hadoop/hdfs/lib or HADOOP_CLASSPATH; typo in the fully-qualified class name in hdfs-site.xml; plugin compiled against a Hadoop version where it no longer implements JournalManager; stale config entry referencing a deleted plugin class.","solutions":["Set dfs.namenode.edits.journal-plugin.<scheme> to the exact fully-qualified name of a class implementing org.apache.hadoop.hdfs.server.namenode.JournalManager","Deploy the plugin JAR to the NameNode classpath (share/hadoop/hdfs/lib or HADOOP_CLASSPATH) on every NameNode and JournalNode host","Remove the custom-scheme URI from dfs.namenode.edits.dir / dfs.namenode.shared.edits.dir if the plugin is no longer used","Recompile the plugin against the JournalManager interface of the running Hadoop version"],"exampleFix":"<!-- before -->\n<property><name>dfs.namenode.edits.journal-plugin.myj</name><value>com.example.MyJournalMgr</value></property>\n<!-- ClassNotFoundException: com.example.MyJournalMgr -->\n\n<!-- after: correct FQCN and JAR in share/hadoop/hdfs/lib -->\n<property><name>dfs.namenode.edits.journal-plugin.myj</name><value>com.example.storage.MyJournalManager</value></property>","handlingStrategy":"validation","validationCode":"// fail fast before NameNode start: every journal-plugin value must load\nfor (Map.Entry<String,String> e : conf.getValByRegex(\n        \"^dfs\\\\.namenode\\\\.edits\\\\.journal-plugin\\\\.\").entrySet()) {\n  Class<?> c = Class.forName(e.getValue());   // ClassNotFoundException -> fix classpath or name\n  if (!org.apache.hadoop.hdfs.server.namenode.JournalManager.class\n      .isAssignableFrom(c)) {\n    throw new IllegalStateException(\n        e.getValue() + \" does not implement JournalManager (key \" + e.getKey() + \")\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  // NameNode / FSEditLog construction\n} catch (IllegalArgumentException e) {\n  Throwable c = e.getCause();\n  while (c != null && !(c.getCause() instanceof ClassNotFoundException)) c = c.getCause();\n  if (c != null) {\n    // plugin class missing from classpath: fix dfs.namenode.edits.journal-plugin.<scheme>\n  }\n  throw e;\n}","preventionTips":["Keep journal-plugin JARs in share/hadoop/hdfs/lib on every NameNode and JournalNode host","Use fully-qualified class names in hdfs-site.xml and review them on each config deploy","Smoke-test NameNode startup on a staging host before restarting production"],"tags":["hdfs","namenode","edit-log","journal-manager","configuration","classpath"],"backgroundTag":"configured-class-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}