pentaho/pentaho-kettle · error · KettleStepException

Xslt.Exception.ErrorResultFieldMissing

Error message

Xslt.Exception.ErrorResultFieldMissing

What it means

The XSLT step requires a result field name configured — the field where the transformed output will be placed. At processRow startup, if meta.getResultfieldname() is empty, the step logs 'ErrorResultFieldMissing' and throws this KettleStepException, aborting the step.

Solutions

  1. Open the XSLT step dialog and set the 'Result fieldname' to a non-empty name.
  2. Verify the saved step XML/repo attributes contain the resultfieldname entry.
  3. Re-create the step if its metadata is corrupted.

Example fix

// before (step dialog left blank)
Result fieldname: (empty)
// after
Result fieldname: result  // receives the XSLT output string
Defensive patterns

Strategy: validation

Validate before calling

if (meta.getResultfieldname() == null || meta.getResultfieldname().isEmpty()) { throw new IllegalArgumentException("XSLT step requires a result fieldname"); } // before adding/executing the step

Try / catch

try { step.startThreads(); } catch (KettleStepException e) { if (e.getMessage().contains("ErrorResultFieldMissing")) { /* prompt user to set Result fieldname */ } }

Prevention

When it happens

Trigger: processRow begins and Utils.isEmpty(meta.getResultfieldname()) is true, i.e. the 'Result fieldname' box in the XSLT step dialog was left blank.

Common situations: Step added to transformation but dialog never fully configured; transformation imported from XML/repo with the result fieldname attribute stripped or missing; copying an older step definition lacking the field.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java:83

    data = (XsltData) sdi;

    Object[] row = getRow();

    if ( row == null ) { // no more input to be expected...
      setOutputDone();
      return false;
    }
    if ( first ) {
      first = false;
      data.outputRowMeta = getInputRowMeta().clone();
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                      metaStore );

      // Check if The result field is given
      if ( Utils.isEmpty( meta.getResultfieldname() ) ) {
        // Result Field is missing !
        logError( BaseMessages.getString( PKG, "Xslt.Log.ErrorResultFieldMissing" ) );
        throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorResultFieldMissing" ) );
      }

      // Check if The XML field is given
      if ( Utils.isEmpty( meta.getFieldname() ) ) {
        // Result Field is missing !
        logError( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXMLFieldMissing" ) );
        throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXMLFieldMissing" ) );
      }

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

View on GitHub (pinned to f3058517a1)