pentaho/pentaho-kettle · error · KettleStepException

XsdValidator.Exception.ErrorFindingXSDField

Error message

XsdValidator.Exception.ErrorFindingXSDField

What it means

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.

Solutions

  1. Fix the XSD field name in the step dialog to match the incoming stream exactly (case-sensitive)
  2. Ensure the upstream step actually emits the field (check with 'Get fields')
  3. Add a Select Values step to alias/rename the field to the expected name
  4. Preview the upstream step to confirm row metadata before the validator

Example fix

// before
meta.setXSDDefinedField("xsdFiled"); // typo, not in stream
// after
meta.setXSDDefinedField("xsdField"); // matches upstream field
Defensive patterns

Strategy: validation

Validate before calling

RowMetaInterface rmi = getInputRowMeta();
if (rmi.indexOfValue(meta.getXSDDefinedField()) < 0) { throw new IllegalStateException("Stream lacks XSD field: " + meta.getXSDDefinedField()); }

Try / catch

try { run(); } catch (KettleStepException e) { if (e.getMessage().contains("ErrorFindingXSDField")) { rebuildUpstreamFields(); } else { throw e; } }

Prevention

When it happens

Trigger: 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.

Common situations: Refactoring upstream Select values / Text file input columns; running transformation with different input source than designed; case-sensitivity mismatch in field names.

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/d719d146ad6daf6a. Report an issue: GitHub.

Appendix: source

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

            }
          }
        }

        // Is XSD field is provided?
        if ( meta.getXSDSource().equals( meta.SPECIFY_FIELDNAME ) ) {
          if ( meta.getXSDDefinedField() == null ) {
            logError( BaseMessages.getString( PKG, "XsdValidator.Log.Error.XSDFieldMissing" ) );
            throw new KettleStepException( BaseMessages.getString( PKG, "XsdValidator.Exception.XSDFieldMissing" ) );
          } else {
            // Let's check if the XSD field exist
            // Try to get XML Field index
            data.xsdindex = getInputRowMeta().indexOfValue( meta.getXSDDefinedField() );

            if ( data.xsdindex < 0 ) {
              // The field is unreachable !
              logError( BaseMessages
                  .getString( PKG, "XsdValidator.Log.ErrorFindingXSDField", meta.getXSDDefinedField() ) );
              throw new KettleStepException( BaseMessages.getString( PKG,
                  "XsdValidator.Exception.ErrorFindingXSDField", meta.getXSDDefinedField() ) );
            }
          }
        }

      } else {
        // XML stream field is missing !
        logError( BaseMessages.getString( PKG, "XsdValidator.Log.Error.XmlStreamFieldMissing" ) );
        throw new KettleStepException( BaseMessages.getString( PKG, "XsdValidator.Exception.XmlStreamFieldMissing" ) );
      }
    }

    try {

      // Get the XML field value
      String XMLFieldvalue = getInputRowMeta().getString( row, data.xmlindex );

      boolean isvalid = false;

View on GitHub (pinned to f3058517a1)