pentaho/pentaho-kettle · error · KettleException
UserDefinedJavaClassMeta.Exception.UnexpectedErrorInReadingS…
Error message
UserDefinedJavaClassMeta.Exception.UnexpectedErrorInReadingStepInfo
What it means
Generic wrap thrown from UserDefinedJavaClassMeta.readRep() when reading the UDJC step's settings from a repository fails unexpectedly. It uses the localized message key UnexpectedErrorInReadingStepInfo and preserves the cause. This happens while loading a transformation definition from a Kettle repository.
Solutions
- Inspect the wrapped cause to see whether it is connectivity or data-related.
- Test repository connection and re-open the transformation.
- Export the transformation to XML and inspect/repair the UDJC step's snippet and field-info attributes.
- If version mismatch, open the transformation in the version it was created with and re-save.
- Recreate the UDJC step and paste the code back if stored attributes are corrupt.
Defensive patterns
Strategy: try-catch
Validate before calling
// Before loading, verify repository reachable
if (!repository.isConnected()) { repository.connect(); } Try / catch
try {
TransMeta tm = new TransMeta(repository, directory, name, metaStore);
} catch (KettleException e) {
if (e.getMessage().contains("UnexpectedErrorInReadingStepInfo")) {
// fall back to loading from XML export
}
} Prevention
- Keep repository connections healthy; reconnect on failure
- Export critical transformations to XML as backup
- Avoid opening transformations written by much older Pentaho versions directly
- Re-save transformations after version upgrades
When it happens
Trigger: Calling readRep during transformation load; underlying rep.getStepAttributeString/Int calls throw (repository connection failure, schema mismatch, corrupt stored attributes, incompatible serialization).
Common situations: Loading an old transformation whose stored step attributes conflict with the current version; DB repository connectivity issues mid-read; corrupted repository rows; manually edited repository data.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- DatabaseJoinMeta.Exception.UnexpectedErrorReadingStepInfo
- ERROR0002.UnexpectedErrorReadingFromTheRepository
- ExecSQLMeta.Exception.UnexpectedErrorReadingStepInfo
- GetTableNamesMeta.Exception.UnexpectedErrorReadingStepInfo
- JobXMLWellFormed.Error.Exception.UnableLoadRep + id_jobentry
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/9dfeff696b7a8021.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/UserDefinedJavaClassMeta.java:625
stepDefinition.stepName =
rep.getStepAttributeString( id_step, i, ElementNames.target_.name() + ElementNames.step_name.name() );
stepDefinition.description =
rep.getStepAttributeString( id_step, i, ElementNames.target_.name()
+ ElementNames.step_description.name() );
targetStepDefinitions.add( stepDefinition );
}
int nrParameters = rep.countNrStepAttributes( id_step, ElementNames.parameter_tag.name() );
for ( int i = 0; i < nrParameters; i++ ) {
UsageParameter usageParameter = new UsageParameter();
usageParameter.tag = rep.getStepAttributeString( id_step, i, ElementNames.parameter_tag.name() );
usageParameter.value = rep.getStepAttributeString( id_step, i, ElementNames.parameter_value.name() );
usageParameter.description =
rep.getStepAttributeString( id_step, i, ElementNames.parameter_description.name() );
usageParameters.add( usageParameter );
}
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString(
PKG, "UserDefinedJavaClassMeta.Exception.UnexpectedErrorInReadingStepInfo" ), e );
}
}
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
try {
for ( int i = 0; i < definitions.size(); i++ ) {
UserDefinedJavaClassDef def = definitions.get( i );
rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.class_name.name(), def.getClassName() );
rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.class_source.name(), def.getSource() );
rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.class_type.name(), def
.getClassType().name() );
}
for ( int i = 0; i < fields.size(); i++ ) {
FieldInfo fi = fields.get( i );
rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.field_name.name(), fi.name );View on GitHub (pinned to f3058517a1)