{"record":{"id":"9dfeff696b7a8021","repo":"pentaho/pentaho-kettle","slug":"userdefinedjavaclassmeta-exception-9dfeff","errorCode":null,"errorMessage":"UserDefinedJavaClassMeta.Exception.UnexpectedErrorInReadingStepInfo","messagePattern":"UserDefinedJavaClassMeta\\.Exception\\.UnexpectedErrorInReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/UserDefinedJavaClassMeta.java","lineNumber":625,"sourceCode":"        stepDefinition.stepName =\n          rep.getStepAttributeString( id_step, i, ElementNames.target_.name() + ElementNames.step_name.name() );\n        stepDefinition.description =\n          rep.getStepAttributeString( id_step, i, ElementNames.target_.name()\n            + ElementNames.step_description.name() );\n        targetStepDefinitions.add( stepDefinition );\n      }\n\n      int nrParameters = rep.countNrStepAttributes( id_step, ElementNames.parameter_tag.name() );\n      for ( int i = 0; i < nrParameters; i++ ) {\n        UsageParameter usageParameter = new UsageParameter();\n        usageParameter.tag = rep.getStepAttributeString( id_step, i, ElementNames.parameter_tag.name() );\n        usageParameter.value = rep.getStepAttributeString( id_step, i, ElementNames.parameter_value.name() );\n        usageParameter.description =\n          rep.getStepAttributeString( id_step, i, ElementNames.parameter_description.name() );\n        usageParameters.add( usageParameter );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"UserDefinedJavaClassMeta.Exception.UnexpectedErrorInReadingStepInfo\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n\n      for ( int i = 0; i < definitions.size(); i++ ) {\n        UserDefinedJavaClassDef def = definitions.get( i );\n        rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.class_name.name(), def.getClassName() );\n        rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.class_source.name(), def.getSource() );\n        rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.class_type.name(), def\n          .getClassType().name() );\n      }\n\n      for ( int i = 0; i < fields.size(); i++ ) {\n        FieldInfo fi = fields.get( i );\n        rep.saveStepAttribute( id_transformation, id_step, i, ElementNames.field_name.name(), fi.name );","sourceCodeStart":607,"sourceCodeEnd":643,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/UserDefinedJavaClassMeta.java#L607-L643","documentation":"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.","triggerScenarios":"Calling readRep during transformation load; underlying rep.getStepAttributeString/Int calls throw (repository connection failure, schema mismatch, corrupt stored attributes, incompatible serialization).","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before loading, verify repository reachable\nif (!repository.isConnected()) { repository.connect(); }","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta(repository, directory, name, metaStore);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"UnexpectedErrorInReadingStepInfo\")) {\n    // fall back to loading from XML export\n  }\n}","preventionTips":["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"],"tags":["kettle","repository","deserialization","udjc"],"backgroundTag":"file-read-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}