{"record":{"id":"7f87f2f53eb56c4b","repo":"pentaho/pentaho-kettle","slug":"transformclassbase-exception-unabletofindfieldhelper","errorCode":null,"errorMessage":"TransformClassBase.Exception.UnableToFindFieldHelper","messagePattern":"TransformClassBase\\.Exception\\.UnableToFindFieldHelper","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/TransformClassBase.java","lineNumber":620,"sourceCode":"\n  private final Map<String, FieldHelper> inFieldHelpers = new HashMap<String, FieldHelper>();\n  private final Map<String, FieldHelper> infoFieldHelpers = new HashMap<String, FieldHelper>();\n  private final Map<String, FieldHelper> outFieldHelpers = new HashMap<String, FieldHelper>();\n\n  public enum Fields {\n    In, Out, Info;\n  }\n\n  public FieldHelper get( Fields type, String name ) throws KettleStepException {\n    FieldHelper fh;\n    switch ( type ) {\n      case In:\n        fh = inFieldHelpers.get( name );\n        if ( fh == null ) {\n          try {\n            fh = new FieldHelper( data.inputRowMeta, name );\n          } catch ( IllegalArgumentException e ) {\n            throw new KettleStepException( BaseMessages.getString(\n              PKG, \"TransformClassBase.Exception.UnableToFindFieldHelper\", type.name(), name ) );\n          }\n          inFieldHelpers.put( name, fh );\n        }\n        break;\n      case Out:\n        fh = outFieldHelpers.get( name );\n        if ( fh == null ) {\n          try {\n            fh = new FieldHelper( data.outputRowMeta, name );\n          } catch ( IllegalArgumentException e ) {\n            throw new KettleStepException( BaseMessages.getString(\n              PKG, \"TransformClassBase.Exception.UnableToFindFieldHelper\", type.name(), name ) );\n          }\n          outFieldHelpers.put( name, fh );\n        }\n        break;\n      case Info:","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/TransformClassBase.java#L602-L638","documentation":"Thrown by TransformClassBase.getFieldHelper when creating a FieldHelper for an In field fails because the field name does not exist in the step's input RowMeta (FieldHelper throws IllegalArgumentException for unknown fields). Wrapped in KettleStepException with the field type and name.","triggerScenarios":"Calling get(Fields.In, \"fieldName\") in UDJC script where fieldName is not a column of the incoming row stream.","commonSituations":"Typo in field name; upstream step schema changed and the column was renamed/dropped; case mismatch (row metadata is case-sensitive); running the script against a different input stream than designed.","solutions":["Fix the field name passed to get(Fields.In, ...) to match an actual input field (check case).","Preview the input rows in Spoon to confirm the field exists in the stream.","Add schema checks in the script (data.inputRowMeta.indexOfValue(name) >= 0) before accessing fields."],"exampleFix":"// before\nObject v = get(Fields.In, \"CustName\").getString(r); // field is 'cust_name'\n// after\nObject v = get(Fields.In, \"cust_name\").getString(r);","handlingStrategy":"validation","validationCode":"// guard before accessing an input field in UDJC\nif (data.inputRowMeta.indexOfValue(\"cust_name\") < 0) throw new KettleStepException(\"Missing input field cust_name\");","typeGuard":"boolean hasInputField(String name) { return data.inputRowMeta != null && data.inputRowMeta.indexOfValue(name) >= 0; }","tryCatchPattern":"try { FieldHelper fh = get(Fields.In, name); ... } catch (KettleStepException e) { logError(\"Input field not found: \" + name, e); throw e; }","preventionTips":["Preview upstream rows to confirm field names/case","Reference fields by constants, not literals","Pin the input schema in the upstream step (Select Values) before UDJC"],"tags":["kettle","udjc","field-not-found","rowmeta"],"backgroundTag":"record-not-found","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"}