pentaho/pentaho-kettle · error · KettleStepException
TransformClassBase.Exception.InvalidFieldsType
Error message
TransformClassBase.Exception.InvalidFieldsType
What it means
Thrown by TransformClassBase.getFieldHelper when the requested Fields type is not one of In, Out, Info (or the handled enum cases). It signals an invalid/unknown field-lookup type combined with a field name, raised as KettleStepException.
Solutions
- Use only Fields.In, Fields.Out, or Fields.Info in UDJC scripts.
- Upgrade or align the Pentaho Kettle engine version so it supports all Fields enum members your script uses.
- Audit generated/copied script code for invalid Fields usages.
Example fix
// before FieldHelper fh = get(Fields.Debug, "x"); // unsupported type // after FieldHelper fh = get(Fields.In, "x");
Defensive patterns
Strategy: type-guard
Validate before calling
// restrict lookups to supported types in your script helpers
Set<String> allowed = new HashSet<>(Arrays.asList("In", "Out", "Info")); if (!allowed.contains(type.name())) throw new KettleStepException("Unsupported field type: " + type.name()); Type guard
boolean isSupportedFieldType(Fields type) { return type == Fields.In || type == Fields.Out || type == Fields.Info; } Try / catch
try { FieldHelper fh = get(type, name); ... } catch (KettleStepException e) { logError("Unsupported field type " + type.name() + " for " + name, e); throw e; } Prevention
- Only use Fields.In/Out/Info in UDJC scripts
- Match engine version to the Fields enum members used
- Review generated/copied code for unsupported field types
When it happens
Trigger: get(Fields.SomeType, name) with an enum member the base class does not handle — only possible via future/extended Fields enum values or reflection-driven/incorrect generated code paths.
Common situations: Using a newer Kettle Fields enum value against an older engine that doesn't implement that branch; custom/patched UDJC variants adding new field types; generated code referencing an invalid field type.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Could not initialize from codeSnippets.xml
- Error executing UserDefinedJavaClass.getFields():
- Error initializing UserDefinedJavaClass to get fields:
- Internal error: invalid repartitioning type: " +…
- TransformClassBase.Exception.UnableToFindTargetStepNameForTa…
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/b1390150eb6e7a37.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/TransformClassBase.java:652
}
outFieldHelpers.put( name, fh );
}
break;
case Info:
fh = infoFieldHelpers.get( name );
if ( fh == null ) {
RowMetaInterface rmi = getTransMeta().getPrevInfoFields( getStepname() );
try {
fh = new FieldHelper( rmi, name );
} catch ( IllegalArgumentException e ) {
throw new KettleStepException( BaseMessages.getString(
PKG, "TransformClassBase.Exception.UnableToFindFieldHelper", type.name(), name ) );
}
infoFieldHelpers.put( name, fh );
}
break;
default:
throw new KettleStepException( BaseMessages.getString(
PKG, "TransformClassBase.Exception.InvalidFieldsType", type.name(), name ) );
}
return fh;
}
public Object[] createOutputRow( Object[] inputRow, int outputRowSize ) {
if ( meta.isClearingResultFields() ) {
return RowDataUtil.allocateRowData( outputRowSize );
} else {
return RowDataUtil.createResizedCopy( inputRow, outputRowSize );
}
}
}
View on GitHub (pinned to f3058517a1)