pentaho/pentaho-kettle · error · KettleStepException

XsdValidator.Exception.CouldnotFindField

Error message

XsdValidator.Exception.CouldnotFindField

What it means

XsdValidator.processRow locates the configured XML stream field in the incoming row via indexOfValue. If the field is missing (index < 0), it logs 'ErrorFindingField' and throws this localized KettleStepException. The step cannot validate because the XML content field does not exist in the stream.

Solutions

  1. Re-open the XSD Validator dialog and select the correct XML field from the current stream
  2. Fix the upstream step to emit the field with the expected name
  3. Use 'Get Fields' to refresh the field list
  4. Add a Select Values step upstream to guarantee the field exists

Example fix

// before
XML stream field: xml_content
// after
XML stream field: xmldata  <!-- matches upstream output -->
Defensive patterns

Strategy: validation

Validate before calling

String xmlField = meta.getXMLStream();
if (xmlField == null || inputRowMeta.indexOfValue(xmlField) < 0) throw new IllegalStateException("XML field missing in stream: " + xmlField);

Type guard

boolean xmlFieldPresent = inputRowMeta.indexOfValue(meta.getXMLStream()) >= 0;

Try / catch

try { step.processRow(); } catch (KettleStepException e) { log.error("XSD Validator field missing; fix field mapping", e); }

Prevention

When it happens

Trigger: processRow on the first row when meta.getXMLStream() names a field absent from getInputRowMeta(), due to upstream rename/removal, wrong field selection in the dialog, or a branch where the field is not produced.

Common situations: Upstream 'Get XML Data' step renamed its output field; XML Validator configured on a stream with different columns; typo in field name.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/3abee5f9a7dfa636. Report an issue: GitHub.

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xsdvalidator/XsdValidator.java:95

      return false;
    }

    if ( first ) {
      first = false;
      data.outputRowMeta = getInputRowMeta().clone();
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                      metaStore );

      // Check if XML stream is given
      if ( meta.getXMLStream() != null ) {
        // Try to get XML Field index
        data.xmlindex = getInputRowMeta().indexOfValue( meta.getXMLStream() );
        // Let's check the Field
        if ( data.xmlindex < 0 ) {
          // The field is unreachable !
          logError( BaseMessages.getString( PKG, "XsdValidator.Log.ErrorFindingField" ) + "[" + meta.getXMLStream()
              + "]" );
          throw new KettleStepException( BaseMessages.getString( PKG, "XsdValidator.Exception.CouldnotFindField", meta
              .getXMLStream() ) );
        }

        // Let's check that Result Field is given
        if ( meta.getResultfieldname() == null ) {
          // Result field is missing !
          logError( BaseMessages.getString( PKG, "XsdValidator.Log.ErrorResultFieldMissing" ) );
          throw new KettleStepException( BaseMessages.getString( PKG, "XsdValidator.Exception.ErrorResultFieldMissing" ) );
        }

        // Is XSD file is provided?
        if ( meta.getXSDSource().equals( meta.SPECIFY_FILENAME ) ) {
          if ( meta.getXSDFilename() == null ) {
            logError( BaseMessages.getString( PKG, "XsdValidator.Log.ErrorXSDFileMissing" ) );
            throw new KettleStepException( BaseMessages.getString( PKG, "XsdValidator.Exception.ErrorXSDFileMissing" ) );
          } else {
            // Is XSD file exists ?
            FileObject xsdfile = null;

View on GitHub (pinned to f3058517a1)