apache/iceberg · error · IllegalArgumentException

Cannot initialize DellClientFactory, missing no-arg construc

Error message

Cannot initialize DellClientFactory, missing no-arg constructor: %s

What it means

DellClientFactories.loadClientFactory builds the implementation class named by the client.factory property via reflection. If the class has no public no-arg constructor, DynConstructors fails with NoSuchMethodException and this IllegalArgumentException is thrown. Dell client factories must be instantiable without arguments.

Source

Thrown at dell/src/main/java/org/apache/iceberg/dell/DellClientFactories.java:45

import org.apache.iceberg.util.PropertyUtil;

public class DellClientFactories {

  private DellClientFactories() {}

  public static DellClientFactory from(Map<String, String> properties) {
    String factoryImpl =
        PropertyUtil.propertyAsString(
            properties, DellProperties.CLIENT_FACTORY, DefaultDellClientFactory.class.getName());
    return loadClientFactory(factoryImpl, properties);
  }

  private static DellClientFactory loadClientFactory(String impl, Map<String, String> properties) {
    DynConstructors.Ctor<DellClientFactory> ctor;
    try {
      ctor = DynConstructors.builder(DellClientFactory.class).hiddenImpl(impl).buildChecked();
    } catch (NoSuchMethodException e) {
      throw new IllegalArgumentException(
          String.format(
              "Cannot initialize DellClientFactory, missing no-arg constructor: %s", impl),
          e);
    }

    DellClientFactory factory;
    try {
      factory = ctor.newInstance();
    } catch (ClassCastException e) {
      throw new IllegalArgumentException(
          String.format(
              "Cannot initialize DellClientFactory, %s does not implement DellClientFactory.",
              impl),
          e);
    }

    factory.initialize(properties);
    return factory;

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Add a public no-arg constructor to the configured DellClientFactory implementation and read configuration from the properties passed later.
  2. Verify the 'client.factory' property points at the intended class (check for typos or a stale class name).
  3. Use DellClientFactories.from(properties) with the built-in default factory if a custom one is unnecessary.

Example fix

// before
class MyEcsFactory implements DellClientFactory {
  MyEcsFactory(String endpoint) { ... }
}
// after
class MyEcsFactory implements DellClientFactory {
  public MyEcsFactory() { }
  @Override
  public void initialize(Map<String, String> properties) { ... }
}
Defensive patterns

Strategy: validation

Validate before calling

Class<?> cls = Class.forName(factoryClassName);
if (java.util.Arrays.stream(cls.getConstructors()).noneMatch(c -> c.getParameterCount() == 0)) {
  throw new IllegalStateException(factoryClassName + " needs a public no-arg constructor");
}

Try / catch

try {
  DellClientFactories.from(properties);
} catch (IllegalArgumentException e) {
  LOG.error("Check client.factory property: {}", e.getMessage(), e);
}

Prevention

When it happens

Trigger: Setting the catalog property 'client.factory' (ClientConfigProperties.CLIENT_FACTORY) to a class that only defines parameterized constructors, e.g. a DellClientFactory subclass requiring config in its constructor.

Common situations: Custom Dell client factory written with a constructor argument; copying an example class that has an injected constructor; upgrading a factory class that gained a required-arg constructor.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/1121bda749e4e228. Report an issue: GitHub.