{"record":{"id":"98f7f12d4d3ea558","repo":"apache/hadoop","slug":"errors-on-getting-mount-table-loader-class-the-fs","errorCode":null,"errorMessage":"Errors on getting mount table loader class. The fs.viewfs.mounttable.config.loader.impl conf is %s. ","messagePattern":"Errors on getting mount table loader class\\. The fs\\.viewfs\\.mounttable\\.config\\.loader\\.impl conf is (.+?)\\. ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java","lineNumber":189,"sourceCode":"      // TODO: Should we fail here.?\n      if (LOG.isDebugEnabled()) {\n        LOG.debug(\n            \"Missing configuration for fs.viewfs.mounttable.path. Proceeding\"\n                + \"with core-site.xml mount-table information if avaialable.\");\n      }\n    }\n    super.initialize(theUri, conf);\n  }\n\n  private MountTableConfigLoader getMountTableConfigLoader(\n      final Configuration conf) {\n    Class<? extends MountTableConfigLoader> clazz =\n        conf.getClass(CONFIG_VIEWFS_MOUNTTABLE_LOADER_IMPL,\n            DEFAULT_MOUNT_TABLE_CONFIG_LOADER_IMPL,\n                MountTableConfigLoader.class);\n\n    if (clazz == null) {\n      throw new RuntimeException(\n          String.format(\"Errors on getting mount table loader class. \"\n              + \"The fs.viewfs.mounttable.config.loader.impl conf is %s. \",\n                  conf.get(CONFIG_VIEWFS_MOUNTTABLE_LOADER_IMPL,\n                      DEFAULT_MOUNT_TABLE_CONFIG_LOADER_IMPL.getName())));\n    }\n\n    try {\n      MountTableConfigLoader mountTableConfigLoader =\n          ReflectionUtils.newInstance(clazz, conf);\n      return mountTableConfigLoader;\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  /**\n   * This method is overridden because in ViewFileSystemOverloadScheme if\n   * overloaded scheme matches with mounted target fs scheme, file system","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java#L171-L207","documentation":"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.","triggerScenarios":"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)).","commonSituations":"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.","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"],"exampleFix":"// before (core-site.xml)\n<property><name>fs.viewfs.mounttable.config.loader.impl</name><value> </value></property>\n\n<!-- after -->\n<property><name>fs.viewfs.mounttable.config.loader.impl</name>\n  <value>com.myco.zk.ZkMountTableConfigLoader</value></property>\n<!-- ZkMountTableConfigLoader implements MountTableConfigLoader and has a public no-arg ctor -->","handlingStrategy":"validation","validationCode":"static void checkLoaderConfig(Configuration conf) throws IllegalStateException {\n  String cn = conf.getTrimmed(\"fs.viewfs.mounttable.config.loader.impl\",\n      \"org.apache.hadoop.fs.viewfs.HCFSMountTableConfigLoader\");\n  try {\n    Class<?> c = Class.forName(cn);\n    if (!MountTableConfigLoader.class.isAssignableFrom(c)) throw new IllegalStateException(cn + \" does not implement MountTableConfigLoader\");\n    c.getConstructor(); // require public no-arg ctor\n  } catch (ReflectiveOperationException e) {\n    throw new IllegalStateException(\"Bad fs.viewfs.mounttable.config.loader.impl: \" + cn, e);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  FileSystem.get(uri, conf);\n} catch (RuntimeException e) {\n  if (e.getCause() != null) log.error(\"loader init failed\", e.getCause()); // real reason is nested\n  throw e;\n}","preventionTips":["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"],"tags":["viewfs","overload-scheme","configuration","reflection","hadoop-common"],"backgroundTag":"invalid-configuration-class","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}