apache/hadoop · error · RuntimeException
Errors on getting mount table loader class. The fs.viewfs.mo
Error message
Errors on getting mount table loader class. The fs.viewfs.mounttable.config.loader.impl conf is %s.
What it means
During ViewFileSystemOverloadScheme.initialize, the mount-table loader class is read from fs.viewfs.mounttable.config.loader.impl (default HCFSMountTableConfigLoader, restricted to the MountTableConfigLoader interface). If class resolution yields null, initialization aborts with a RuntimeException carrying this message; the following block separately wraps any ReflectionUtils.newInstance failure (missing public no-arg constructor, class not on classpath) in a RuntimeException whose cause holds the real error.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java:189
// TODO: Should we fail here.?
if (LOG.isDebugEnabled()) {
LOG.debug(
"Missing configuration for fs.viewfs.mounttable.path. Proceeding"
+ "with core-site.xml mount-table information if avaialable.");
}
}
super.initialize(theUri, conf);
}
private MountTableConfigLoader getMountTableConfigLoader(
final Configuration conf) {
Class<? extends MountTableConfigLoader> clazz =
conf.getClass(CONFIG_VIEWFS_MOUNTTABLE_LOADER_IMPL,
DEFAULT_MOUNT_TABLE_CONFIG_LOADER_IMPL,
MountTableConfigLoader.class);
if (clazz == null) {
throw new RuntimeException(
String.format("Errors on getting mount table loader class. "
+ "The fs.viewfs.mounttable.config.loader.impl conf is %s. ",
conf.get(CONFIG_VIEWFS_MOUNTTABLE_LOADER_IMPL,
DEFAULT_MOUNT_TABLE_CONFIG_LOADER_IMPL.getName())));
}
try {
MountTableConfigLoader mountTableConfigLoader =
ReflectionUtils.newInstance(clazz, conf);
return mountTableConfigLoader;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* This method is overridden because in ViewFileSystemOverloadScheme if
* overloaded scheme matches with mounted target fs scheme, file systemView on GitHub (pinned to 2add963021)
Solutions
- Unset fs.viewfs.mounttable.config.loader.impl to fall back to the default HCFSMountTableConfigLoader
- Set it to a fully-qualified class implementing MountTableConfigLoader with a public no-arg constructor
- Verify the class is on the client classpath and the name has no typos/whitespace (getTrimmed is used)
- When the RuntimeException wraps a cause, inspect getCause() — it usually names the missing class or constructor
Example fix
// before (core-site.xml) <property><name>fs.viewfs.mounttable.config.loader.impl</name><value> </value></property> <!-- after --> <property><name>fs.viewfs.mounttable.config.loader.impl</name> <value>com.myco.zk.ZkMountTableConfigLoader</value></property> <!-- ZkMountTableConfigLoader implements MountTableConfigLoader and has a public no-arg ctor -->
Defensive patterns
Strategy: validation
Validate before calling
static void checkLoaderConfig(Configuration conf) throws IllegalStateException {
String cn = conf.getTrimmed("fs.viewfs.mounttable.config.loader.impl",
"org.apache.hadoop.fs.viewfs.HCFSMountTableConfigLoader");
try {
Class<?> c = Class.forName(cn);
if (!MountTableConfigLoader.class.isAssignableFrom(c)) throw new IllegalStateException(cn + " does not implement MountTableConfigLoader");
c.getConstructor(); // require public no-arg ctor
} catch (ReflectiveOperationException e) {
throw new IllegalStateException("Bad fs.viewfs.mounttable.config.loader.impl: " + cn, e);
}
} Try / catch
try {
FileSystem.get(uri, conf);
} catch (RuntimeException e) {
if (e.getCause() != null) log.error("loader init failed", e.getCause()); // real reason is nested
throw e;
} Prevention
- Validate the loader FQCN in config-lint checks before deploy
- Custom loaders must implement MountTableConfigLoader and expose a public no-arg constructor
- Keep the loader jar on every client/gateway classpath
When it happens
Trigger: Setting fs.viewfs.mounttable.config.loader.impl to an empty string, a placeholder, or a value that Configuration maps to no class, then new FileSystem.get(uri, conf) with fs.<scheme>.impl=...ViewFileSystemOverloadScheme; also a custom loader lacking a public no-arg constructor (InstantiationException surfaced as RuntimeException(e)).
Common situations: Custom MountTableConfigLoader implementations (mount tables fetched from ZooKeeper/external services) wired into overload-scheme clusters; typo'd FQCNs in core-site.xml; shaded/relocated deployments where the loader class is not on the client classpath.
Related errors
- %s=null: %s: %s
- No link found for the given path. on path `{}' is not within
- Home dir should start with /:{homedir}
- ViewFs: Non absolute mount name in config:{src}
- Path {nextInode.fullPath} already exists as link
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/98f7f12d4d3ea558.
Report an issue: GitHub.