apache/iceberg · error · IllegalArgumentException

Cannot create %s to generate and configure the client SDK Pl

Error message

Cannot create %s to generate and configure the client SDK Plugin builder

What it means

IllegalArgumentException thrown when dynamically loading an S3 SDK plugin configuration class via DynMethods: the configured class was found but has no static create(Map) method (NoSuchMethodException from buildStaticChecked). This happens when s3.sdk-plugins (or similar) names a class that does not implement the expected plugin factory contract of a static create(Map<String, String>) method returning the builder/plugin instance.

Source

Thrown at aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIOProperties.java:1190

  public S3CrtAsyncClientBuilder applyS3CrtConfigurations(S3CrtAsyncClientBuilder builder) {
    return builder.maxConcurrency(s3CrtMaxConcurrency());
  }

  /**
   * Dynamically load the http client builder to avoid runtime deps requirements of any optional SDK
   * Plugins
   */
  private <T> T loadSdkPluginConfigurations(String impl, Map<String, String> properties) {
    Object sdkPluginConfigurations;
    try {
      sdkPluginConfigurations =
          DynMethods.builder("create")
              .hiddenImpl(impl, Map.class)
              .buildStaticChecked()
              .invoke(properties);
      return (T) sdkPluginConfigurations;
    } catch (NoSuchMethodException e) {
      throw new IllegalArgumentException(
          String.format(
              "Cannot create %s to generate and configure the client SDK Plugin builder", impl),
          e);
    }
  }

  public Map<String, String> properties() {
    return allProperties;
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Ensure the configured class exposes public static T create(java.util.Map<String, String> properties) with exactly that signature.
  2. Verify the fully-qualified class name in s3.sdk-plugins is correct and the class is on the classpath.
  3. Update the custom plugin to match the current Iceberg SDK plugin contract, or use a shipped implementation (e.g. S3ClientConfigurations).
  4. If create exists but with a different parameter type, add an overload accepting Map<String, String>.

Example fix

// before
class MyPlugin {
  public MyPlugin(Map<String, String> props) { ... } // no static create(Map) -> IllegalArgumentException
}
// after
class MyPlugin {
  public static MyPlugin create(Map<String, String> properties) {
    return new MyPlugin(properties);
  }
  private MyPlugin(Map<String, String> props) { ... }
}
Defensive patterns

Strategy: validation

Validate before calling

Class<?> impl = Class.forName(pluginClassName);
Method create = impl.getMethod("create", Map.class);
if (!java.lang.reflect.Modifier.isStatic(create.getModifiers())) {
  throw new IllegalArgumentException("create must be static");
}

Try / catch

try {
  props = S3FileIOProperties.loadSdkPlugin(impl, properties);
} catch (IllegalArgumentException e) {
  throw new IllegalStateException("s3.sdk-plugins class lacks static create(Map) method: " + impl, e);
}

Prevention

When it happens

Trigger: Configuring s3.sdk-plugins=<impl> where impl resolves to a class lacking a visible static create(Map) method, or whose signature doesn't match Map.class (e.g. create(Properties), or non-static create).

Common situations: Custom S3ClientConfigurations/SdkPlugin class written against an older Iceberg/AWS SDK contract; wrong fully-qualified class name resolving to a different class; class compiled with a non-static or differently typed create method; typos pointing at a wrapper class instead of the plugin factory.

Related errors


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