pentaho/pentaho-kettle · error · UIObjectCreationException

Unable to instantiate object for

Error message

Unable to instantiate object for 

What it means

UIObjectRegistry.constructUIJob() reflectively instantiates the registered UIJob class. If newInstance() fails for any reason (constructor throws, instantiation error, illegal access), it throws UIObjectCreationException 'Unable to instantiate object for ' + jobClass. Note the original exception is swallowed, hiding the real cause.

Solutions

  1. Ensure the registered UIJob class has a public constructor matching (RepositoryElementMetaInterface, UIRepositoryDirectory, Repository)
  2. Log or inspect the caught Exception e — temporarily add e as the exception cause to find the root failure
  3. Revert custom registry registrations to the default UIObjectRegistry classes
  4. Check the class is loadable by the current classloader (no plugin classloader mismatch)

Example fix

// before
throw new UIObjectCreationException( "Unable to instantiate object for " + jobClass );
// after
throw new UIObjectCreationException( "Unable to instantiate object for " + jobClass, e );
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the registered class has the expected constructor
jobClass.getConstructor(RepositoryElementMetaInterface.class, UIRepositoryDirectory.class, Repository.class);

Type guard

boolean isInstantiableUIJob(Class<?> c) {
  try { c.getConstructor(RepositoryElementMetaInterface.class, UIRepositoryDirectory.class, Repository.class); return !c.isInterface() && !java.lang.reflect.Modifier.isAbstract(c.getModifiers()); }
  catch (NoSuchMethodException e) { return false; }
}

Try / catch

try { UIJob job = registry.constructUIJob(rc, parent, rep); } catch (UIObjectCreationException e) { log.error("Registry misconfiguration for UIJob", e); UIJob job = new UIJob(rc, parent, rep); // default fallback }

Prevention

When it happens

Trigger: The registered UIJob subclass lacks a (RepositoryElementMetaInterface, UIRepositoryDirectory, Repository) constructor, its constructor throws, or the class cannot be instantiated under the current classloader.

Common situations: Custom UIObjectRegistry configuration registering a job class with a mismatched constructor signature; classloader issues in plugin/SWT environments; upgraded PDI version changed the expected constructor; the constructor throws NPE because Repository is null.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/b14d5914e9eca24a. Report an issue: GitHub.

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/repository/repositoryexplorer/model/UIObjectRegistry.java:115

        throw new UIObjectCreationException( "Unable to get the constructor for " + repositoryUserClass );
      }
    } catch ( Exception e ) {
      throw new UIObjectCreationException( "Unable to instantiate object for " + repositoryUserClass );
    }
  }

  public UIJob constructUIJob( RepositoryElementMetaInterface rc, UIRepositoryDirectory parent, Repository rep ) throws UIObjectCreationException {
    try {
      Constructor<?> constructor =
        jobClass.getConstructor(
          RepositoryElementMetaInterface.class, UIRepositoryDirectory.class, Repository.class );
      if ( constructor != null ) {
        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 );
    }
  }

View on GitHub (pinned to f3058517a1)