apache/iceberg · error · UnsupportedOperationException
Failed to load Configuration.setConf after loading Configura
Error message
Failed to load Configuration.setConf after loading Configurable
What it means
After loading a Configurable and its Hadoop Configuration class, configureHadoopConf reflectively looks up the setConf(Configuration) method and binds it to the instance. If setConf cannot be found on the loaded Configurable, this UnsupportedOperationException is thrown. It is an internal-invariant error: any class implementing Configurable must define setConf, so this signals an unexpectedly malformed or mismatched class.
Source
Thrown at core/src/main/java/org/apache/iceberg/CatalogUtil.java:497
"Failed to load Configuration after loading Configurable", e);
}
ValidationException.check(
configurationClass.isInstance(conf),
"%s is not an instance of Configuration from the classloader for %s",
conf,
maybeConfigurable);
DynMethods.BoundMethod setConf;
try {
setConf =
DynMethods.builder("setConf")
.impl(configurableInterface, configurationClass)
.buildChecked()
.bind(maybeConfigurable);
} catch (NoSuchMethodException e) {
// this shouldn't happen because Configurable was loaded and defines setConf
throw new UnsupportedOperationException(
"Failed to load Configuration.setConf after loading Configurable", e);
}
setConf.invoke(conf);
}
/**
* Load a custom {@link MetricsReporter} implementation.
*
* <p>The implementation must have a no-arg constructor.
*
* @param properties catalog properties which contains class name of a custom {@link
* MetricsReporter} implementation
* @return An initialized {@link MetricsReporter}.
* @throws IllegalArgumentException if class path not found or right constructor not found or the
* loaded class cannot be cast to the given interface type
*/
public static MetricsReporter loadMetricsReporter(Map<String, String> properties) {View on GitHub (pinned to 86d9c8fc54)
Solutions
- Ensure only one copy of org.apache.hadoop.conf.Configurable exists on the classpath (no duplicate/relocated hadoop jars).
- Make sure the same classloader loads the implementation, Configurable, and Configuration classes.
- Check shade plugin excludes so hadoop configuration classes are not relocated in plugin jars.
- Align hadoop-common versions between the application and the catalog/FileIO plugin.
Defensive patterns
Strategy: try-catch
Validate before calling
Class<?> implClass = Class.forName(implName, true, loader);
if (!org.apache.hadoop.conf.Configurable.class.isAssignableFrom(implClass)) {
throw new IllegalStateException("implementation is not a Hadoop Configurable");
} Type guard
boolean definesSetConf(Class<?> c, ClassLoader cl) {
try {
Class<?> conf = Class.forName("org.apache.hadoop.conf.Configuration", false, cl);
return java.lang.reflect.Modifier.isPublic(c.getModifiers())
&& java.util.Arrays.stream(c.getMethods())
.anyMatch(m -> m.getName().equals("setConf")
&& m.getParameterCount() == 1 && m.getParameterTypes()[0] == conf);
} catch (ClassNotFoundException e) { return false; }
} Try / catch
try {
CatalogUtil.loadFileIO(fileIOImpl, properties, hadoopConf);
} catch (UnsupportedOperationException e) {
if (e.getMessage() != null && e.getMessage().contains("setConf")) {
// duplicated/relocated Configurable classes — log classloader sources before rethrowing
}
throw e;
} Prevention
- Keep exactly one copy of org.apache.hadoop classes on the classpath.
- Do not relocate hadoop classes in shaded plugin jars.
- Pin one hadoop-common version across the application and plugins.
When it happens
Trigger: CatalogUtil.loadCatalog or loadFileIO receives a class whose Configurable interface was loaded from a different classloader than the instance's own classloader, so DynMethods cannot resolve setConf(Configuration) with the Configuration class argument; or the class implements a relocated/shaded Configurable variant.
Common situations: Shading that relocates org.apache.hadoop.conf.Configurable on one side but not the other; mixed Hadoop versions on the classpath; custom classloaders loading duplicate copies of Configurable/Configuration.
Related errors
- Failed to load Configuration after loading Configurable
- Cannot initialize AliyunClientFactory, missing no-arg constr
- Cannot initialize AliyunClientFactory, %s does not implement
- Unknown transform class %s
- org.apache.iceberg.arrow.vectorized.ArrowVectorAccessors can
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/379a102d0d4765f8.
Report an issue: GitHub.