{"record":{"id":"d719d146ad6daf6a","repo":"pentaho/pentaho-kettle","slug":"xsdvalidator-exception-errorfindingxsdfield","errorCode":null,"errorMessage":"XsdValidator.Exception.ErrorFindingXSDField","messagePattern":"XsdValidator\\.Exception\\.ErrorFindingXSDField","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java","lineNumber":150,"sourceCode":"            }\n          }\n        }\n\n        // Is XSD field is provided?\n        if ( meta.getXSDSource().equals( meta.SPECIFY_FIELDNAME ) ) {\n          if ( meta.getXSDDefinedField() == null ) {\n            logError( BaseMessages.getString( PKG, \"XsdValidator.Log.Error.XSDFieldMissing\" ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.XSDFieldMissing\" ) );\n          } else {\n            // Let's check if the XSD field exist\n            // Try to get XML Field index\n            data.xsdindex = getInputRowMeta().indexOfValue( meta.getXSDDefinedField() );\n\n            if ( data.xsdindex < 0 ) {\n              // The field is unreachable !\n              logError( BaseMessages\n                  .getString( PKG, \"XsdValidator.Log.ErrorFindingXSDField\", meta.getXSDDefinedField() ) );\n              throw new KettleStepException( BaseMessages.getString( PKG,\n                  \"XsdValidator.Exception.ErrorFindingXSDField\", meta.getXSDDefinedField() ) );\n            }\n          }\n        }\n\n      } else {\n        // XML stream field is missing !\n        logError( BaseMessages.getString( PKG, \"XsdValidator.Log.Error.XmlStreamFieldMissing\" ) );\n        throw new KettleStepException( BaseMessages.getString( PKG, \"XsdValidator.Exception.XmlStreamFieldMissing\" ) );\n      }\n    }\n\n    try {\n\n      // Get the XML field value\n      String XMLFieldvalue = getInputRowMeta().getString( row, data.xmlindex );\n\n      boolean isvalid = false;","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java#L132-L168","documentation":"KettleStepException thrown when the configured XSD field name does not exist in the incoming row layout: getInputRowMeta().indexOfValue(field) returns -1. The field holding the schema cannot be located.","triggerScenarios":"Upstream step renamed/removed the field; wrong field name typed; row metadata changed between preview and run so the configured field no longer exists in the stream.","commonSituations":"Refactoring upstream Select values / Text file input columns; running transformation with different input source than designed; case-sensitivity mismatch in field names.","solutions":["Fix the XSD field name in the step dialog to match the incoming stream exactly (case-sensitive)","Ensure the upstream step actually emits the field (check with 'Get fields')","Add a Select Values step to alias/rename the field to the expected name","Preview the upstream step to confirm row metadata before the validator"],"exampleFix":"// before\nmeta.setXSDDefinedField(\"xsdFiled\"); // typo, not in stream\n// after\nmeta.setXSDDefinedField(\"xsdField\"); // matches upstream field","handlingStrategy":"validation","validationCode":"RowMetaInterface rmi = getInputRowMeta();\nif (rmi.indexOfValue(meta.getXSDDefinedField()) < 0) { throw new IllegalStateException(\"Stream lacks XSD field: \" + meta.getXSDDefinedField()); }","typeGuard":null,"tryCatchPattern":"try { run(); } catch (KettleStepException e) { if (e.getMessage().contains(\"ErrorFindingXSDField\")) { rebuildUpstreamFields(); } else { throw e; } }","preventionTips":["Use 'Get fields' in the dialog instead of typing field names","Avoid renaming upstream fields without checking downstream steps","Preview the hop feeding the validator before runs"],"tags":["kettle","xsd-validator","field-not-found","row-metadata"],"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"}