pentaho/pentaho-kettle · error · org.pentaho.di.core.exception.KettleValueException

KettleValueException wrapping KettlePluginException from…

Error message

KettleValueException wrapping KettlePluginException from cloneToType (no message; cause carries detail)

What it means

cloneToType creates a new RowMeta of a target type (e.g. to clone metadata between binary/string representations). The RowMeta copy constructor may throw KettlePluginException when ValueMetaFactory cannot create a value meta of the requested type. RowMeta translates that into a KettleValueException because cloneToType's signature only declares KettleValueException; the root cause and its message are carried on the exception's cause.

Solutions

  1. Inspect getCause() of the KettleValueException to find the underlying KettlePluginException detail message.
  2. Verify all Kettle value-type plugin jars are present on the classpath / in the plugins directory.
  3. Ensure the PDI core and plugin versions match the target value type; upgrade/downgrade to a consistent set of jars.
  4. If wrapping a custom ValueMeta, confirm its class is public, has a no-arg/copy constructor, and is registered with ValueMetaFactory.

Example fix

// before
RowMetaInterface stringClone = rowMeta.cloneToType(ValueMetaInterface.TYPE_STRING);
// after
try {
  RowMetaInterface stringClone = rowMeta.cloneToType(ValueMetaInterface.TYPE_STRING);
} catch (KettleValueException e) {
  log.error("cloneToType failed: " + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()), e);
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (rowMeta == null || rowMeta.size() == 0) { throw new IllegalStateException("Cannot clone empty RowMeta"); }

Try / catch

try {
  RowMetaInterface clone = rowMeta.cloneToType(ValueMetaInterface.TYPE_STRING);
} catch (KettleValueException e) {
  Throwable cause = e.getCause();
  log.error("cloneToType failed: " + (cause != null ? cause.getMessage() : e.getMessage()), e);
}

Prevention

When it happens

Trigger: Calling rowMeta.cloneToType(ValueMetaInterface.TYPE_...) where cloning a value meta requires the plugin factory to instantiate a value class that is missing, not registered, or whose constructor fails (e.g. an unknown/removed value type plugin on the classpath).

Common situations: PDI plugin jar missing from plugins/ directory so a custom value type cannot be instantiated; version mismatch where a value type class was renamed/moved between Pentaho/PDI versions; classloader issues when embedding Kettle in an application.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/RowMeta.java:108

    } finally {
      lock.readLock().unlock();
    }
  }

  /**
   * This method copies the row metadata and sets all values to the specified type (usually String)
   *
   * @param targetType The target type
   * @return The cloned metadata
   * @throws if the target type could not be loaded from the plugin registry
   */
  @Override
  public RowMetaInterface cloneToType( int targetType ) throws KettleValueException {
    lock.readLock().lock();
    try {
      return new RowMeta( this, targetType );
    } catch ( KettlePluginException e ) {
      throw new KettleValueException( e );
    } finally {
      lock.readLock().unlock();
    }
  }

  @Override
  public String toString() {
    StringBuilder buffer = new StringBuilder();
    lock.readLock().lock();
    try {
      boolean notFirst = false;
      for ( ValueMetaInterface valueMeta : valueMetaList ) {
        if ( notFirst ) {
          buffer.append( ", " );
        } else {
          notFirst = true;
        }
        buffer.append( "[" ).append( valueMeta.toString() ).append( "]" );

View on GitHub (pinned to f3058517a1)