apache/hadoop · error · RuntimeException

Errors on getting mount table loader class. The…

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.

Solutions

  1. Unset fs.viewfs.mounttable.config.loader.impl to fall back to the default HCFSMountTableConfigLoader
  2. Set it to a fully-qualified class implementing MountTableConfigLoader with a public no-arg constructor
  3. Verify the class is on the client classpath and the name has no typos/whitespace (getTrimmed is used)
  4. 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

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


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/98f7f12d4d3ea558. Report an issue: GitHub.

Appendix: 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 system

View on GitHub (pinned to 2add963021)