{"record":{"id":"1121bda749e4e228","repo":"apache/iceberg","slug":"cannot-initialize-dellclientfactory-missing-no-ar","errorCode":null,"errorMessage":"Cannot initialize DellClientFactory, missing no-arg constructor: %s","messagePattern":"Cannot initialize DellClientFactory, missing no-arg constructor: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dell/src/main/java/org/apache/iceberg/dell/DellClientFactories.java","lineNumber":45,"sourceCode":"import org.apache.iceberg.util.PropertyUtil;\n\npublic class DellClientFactories {\n\n  private DellClientFactories() {}\n\n  public static DellClientFactory from(Map<String, String> properties) {\n    String factoryImpl =\n        PropertyUtil.propertyAsString(\n            properties, DellProperties.CLIENT_FACTORY, DefaultDellClientFactory.class.getName());\n    return loadClientFactory(factoryImpl, properties);\n  }\n\n  private static DellClientFactory loadClientFactory(String impl, Map<String, String> properties) {\n    DynConstructors.Ctor<DellClientFactory> ctor;\n    try {\n      ctor = DynConstructors.builder(DellClientFactory.class).hiddenImpl(impl).buildChecked();\n    } catch (NoSuchMethodException e) {\n      throw new IllegalArgumentException(\n          String.format(\n              \"Cannot initialize DellClientFactory, missing no-arg constructor: %s\", impl),\n          e);\n    }\n\n    DellClientFactory factory;\n    try {\n      factory = ctor.newInstance();\n    } catch (ClassCastException e) {\n      throw new IllegalArgumentException(\n          String.format(\n              \"Cannot initialize DellClientFactory, %s does not implement DellClientFactory.\",\n              impl),\n          e);\n    }\n\n    factory.initialize(properties);\n    return factory;","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/dell/src/main/java/org/apache/iceberg/dell/DellClientFactories.java#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a public no-arg constructor to the configured DellClientFactory implementation and read configuration from the properties passed later.","Verify the 'client.factory' property points at the intended class (check for typos or a stale class name).","Use DellClientFactories.from(properties) with the built-in default factory if a custom one is unnecessary."],"exampleFix":"// before\nclass MyEcsFactory implements DellClientFactory {\n  MyEcsFactory(String endpoint) { ... }\n}\n// after\nclass MyEcsFactory implements DellClientFactory {\n  public MyEcsFactory() { }\n  @Override\n  public void initialize(Map<String, String> properties) { ... }\n}","handlingStrategy":"validation","validationCode":"Class<?> cls = Class.forName(factoryClassName);\nif (java.util.Arrays.stream(cls.getConstructors()).noneMatch(c -> c.getParameterCount() == 0)) {\n  throw new IllegalStateException(factoryClassName + \" needs a public no-arg constructor\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  DellClientFactories.from(properties);\n} catch (IllegalArgumentException e) {\n  LOG.error(\"Check client.factory property: {}\", e.getMessage(), e);\n}","preventionTips":["Always give custom DellClientFactory impls a public no-arg constructor","Pass configuration via initialize(properties), not constructor args","Double-check the fully-qualified class name in 'client.factory'"],"tags":["dell","reflection","configuration","constructor"],"backgroundTag":"invalid-constructor-argument","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}