pentaho/pentaho-kettle · error · UIObjectCreationException
Unable to get the constructor for
Error message
Unable to get the constructor for
What it means
UIObjectRegistry.constructUITransformation() looks up a Constructor<init>(RepositoryElementMetaInterface, UIRepositoryDirectory, Repository) on the registered transformation class via getConstructor(). If getConstructor() throws NoSuchMethodException, the code throws UIObjectCreationException 'Unable to get the constructor for ' + transClass. (The index's message text corresponds to the sibling instantiate branch, but this throw site fires when the required constructor signature is missing.)
Solutions
- Add/fix a public constructor with the exact signature (RepositoryElementMetaInterface, UIRepositoryDirectory, Repository) in the registered class
- Recompile the custom class against the current PDI UI library version
- Remove the custom registration so the default UITransformation is used
- Check that getConstructor's parameter types exactly match, including the Repository interface (not a concrete class)
Example fix
// before
public MyUITransformation( RepositoryElementMetaInterface rc, UIRepositoryDirectory parent ) { ... }
// after
public MyUITransformation( RepositoryElementMetaInterface rc, UIRepositoryDirectory parent, Repository rep ) { ... } Defensive patterns
Strategy: type-guard
Validate before calling
try {
transClass.getConstructor(RepositoryElementMetaInterface.class, UIRepositoryDirectory.class, Repository.class);
} catch (NoSuchMethodException e) {
throw new IllegalStateException(transClass + " lacks required UI constructor", e);
} Type guard
boolean hasUITransConstructor(Class<?> c) {
try { c.getConstructor(RepositoryElementMetaInterface.class, UIRepositoryDirectory.class, Repository.class); return true; }
catch (NoSuchMethodException e) { return false; }
} Try / catch
try { UITransformation t = registry.constructUITransformation(rc, parent, rep); } catch (UIObjectCreationException e) { log.error("Constructor missing on " + e.getMessage(), e); UITransformation t = new UITransformation(rc, parent, rep); } Prevention
- Compile custom UITransformation subclasses against the exact PDI version in use
- Always include the full 3-argument public constructor in registry classes
- Run a startup smoke test that constructs each registered class
- Avoid parameter type substitutions (concrete class for interface) in constructors
When it happens
Trigger: Registering a custom UITransformation subclass that does not declare a public constructor taking (RepositoryElementMetaInterface, UIRepositoryDirectory, Repository), so getConstructor() finds nothing.
Common situations: Custom registry extension after a PDI upgrade changed constructor signatures; class written against an older UITransformation API; typo'd or non-public constructor in a custom class.
Related errors
- Unable to get the constructor for
- Unable to instantiate object for
- Can't create object
- Constructor not found for
- DefaultAuthenticationConsumerFactory.Constructor
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/83907b158a171ac2.
Report an issue: GitHub.
Appendix: source
Thrown at ui/src/main/java/org/pentaho/di/ui/repository/repositoryexplorer/model/UIObjectRegistry.java:128
return (UIJob) constructor.newInstance( rc, parent, rep );
} else {
throw new UIObjectCreationException( "Unable to get the constructor for " + jobClass );
}
} catch ( Exception e ) {
throw new UIObjectCreationException( "Unable to instantiate object for " + jobClass );
}
}
public UITransformation constructUITransformation( RepositoryElementMetaInterface rc,
UIRepositoryDirectory parent, Repository rep ) throws UIObjectCreationException {
try {
Constructor<?> constructor =
transClass.getConstructor(
RepositoryElementMetaInterface.class, UIRepositoryDirectory.class, Repository.class );
if ( constructor != null ) {
return (UITransformation) constructor.newInstance( rc, parent, rep );
} else {
throw new UIObjectCreationException( "Unable to get the constructor for " + transClass );
}
} catch ( Exception e ) {
throw new UIObjectCreationException( "Unable to instantiate object for " + transClass );
}
}
public UIRepositoryDirectory constructUIRepositoryDirectory( RepositoryDirectoryInterface rd,
UIRepositoryDirectory uiParent, Repository rep ) throws UIObjectCreationException {
try {
Constructor<?> constructor =
dirClass.getConstructor(
RepositoryDirectoryInterface.class, UIRepositoryDirectory.class, Repository.class );
if ( constructor != null ) {
return (UIRepositoryDirectory) constructor.newInstance( rd, uiParent, rep );
} else {
throw new UIObjectCreationException( "Unable to get the constructor for " + dirClass );
}
} catch ( Exception e ) {View on GitHub (pinned to f3058517a1)