apache/hadoop · error · IllegalArgumentException
No class configured for {}
Error message
No class configured for {} What it means
Same lookup in FSEditLog.getJournalClass, but conf.getClass returned null: the key dfs.namenode.edits.journal-plugin.<scheme> is absent. An edits URI uses a scheme for which no JournalManager implementation is registered, so getJournalClass throws IllegalArgumentException('No class configured for <scheme>') after logging a warning that names the missing key.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java:1864
* @return the class of the journal implementation
* @throws IllegalArgumentException if no class is configured for uri
*/
static Class<? extends JournalManager> getJournalClass(Configuration conf,
String uriScheme) {
String key
= DFSConfigKeys.DFS_NAMENODE_EDITS_PLUGIN_PREFIX + "." + uriScheme;
Class <? extends JournalManager> clazz = null;
try {
clazz = conf.getClass(key, null, JournalManager.class);
} catch (RuntimeException re) {
throw new IllegalArgumentException(
"Invalid class specified for " + uriScheme, re);
}
if (clazz == null) {
LOG.warn("No class configured for " +uriScheme
+ ", " + key + " is empty");
throw new IllegalArgumentException(
"No class configured for " + uriScheme);
}
return clazz;
}
/**
* Construct a custom journal manager.
* The class to construct is taken from the configuration.
* @param uri Uri to construct
* @return The constructed journal manager
* @throws IllegalArgumentException if no class is configured for uri
*/
@VisibleForTesting
JournalManager createJournal(URI uri) {
Class<? extends JournalManager> clazz
= getJournalClass(conf, uri.getScheme());
try {View on GitHub (pinned to 2add963021)
Solutions
- Add dfs.namenode.edits.journal-plugin.<scheme>=<fully-qualified JournalManager class> to hdfs-site.xml
- Fix the scheme in dfs.namenode.edits.dir / dfs.namenode.shared.edits.dir: file:// for local edits, qjm://HOST:PORT;HOST:PORT;HOST:PORT/JOURNALNAME for QuorumJournalManager
- Verify the effective value on the failing host with 'hdfs getconf -confKey dfs.namenode.edits.dir' to confirm the property is loaded
Example fix
<!-- before: myj:// URI present, no plugin registered --> <property><name>dfs.namenode.edits.dir</name><value>myj://journalhost:8220/nn</value></property> <!-- after: register the scheme handler --> <property><name>dfs.namenode.edits.journal-plugin.myj</name><value>com.example.storage.MyJournalManager</value></property>
Defensive patterns
Strategy: validation
Validate before calling
// every scheme used in edits dirs must be built-in or have a plugin entry
Set<String> builtin = new HashSet<>(Arrays.asList("file", "qjm", "hftp", "https"));
for (URI u : FSNamesystem.getNamespaceEditsDirs(conf)) {
String scheme = u.getScheme();
boolean known = scheme == null || builtin.contains(scheme)
|| conf.get("dfs.namenode.edits.journal-plugin." + scheme) != null;
if (!known) {
throw new IllegalStateException(
"No dfs.namenode.edits.journal-plugin." + scheme + " configured for " + u);
}
} Try / catch
try {
// NameNode / FSEditLog construction
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().startsWith("No class configured for")) {
// e.getMessage() names the scheme: add dfs.namenode.edits.journal-plugin.<scheme>
}
throw e;
} Prevention
- Lint edits-dir schemes against the journal-plugin keys in config review
- Confirm effective config on the failing host with 'hdfs getconf -confKey dfs.namenode.edits.dir'
- Keep custom scheme names short and stable to avoid typos
When it happens
Trigger: dfs.namenode.edits.dir or dfs.namenode.shared.edits.dir contains a URI whose scheme has no built-in handler (not file or qjm) and no dfs.namenode.edits.journal-plugin.<scheme> property exists. Also hit when a scheme is misspelled, so it resolves to no plugin at all.
Common situations: Typo in the edits URI scheme (for example 'qjm3:' instead of 'qjm:'); plugin property deleted during config cleanup while the URI stayed; property placed in a config file the failing host does not load; config migration dropping custom journal entries.
Related errors
- Invalid class specified for {}
- Unable to construct journal, {}
- Multiple shared edits directories are not yet supported
- Remote NameNodes not correctly configured!
- Unknown nameservice: {}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/c0c43234b40daf95.
Report an issue: GitHub.