pentaho/pentaho-kettle · error · KettleException

e.toString()

Error message

e.toString()

What it means

In processPutRow, when an exception occurs while building an output row and step error handling is enabled, the row is routed to the error stream with e.toString() as the error description (code GetXMLData001). Without error handling enabled, the same message is logged and rethrown as a KettleException, failing the transformation.

Solutions

  1. Read e.toString() from the error stream / log to identify which field failed conversion.
  2. Correct the field's Format/Length/Precision in the Fields tab to match the data (e.g. set proper date mask).
  3. Enable step error handling (putError path) to redirect bad rows to an error stream instead of failing.
  4. Adjust the Loop XPath or field XPath so it extracts the expected element/text values.

Example fix

// before: number format mismatch
field.setFormat( "#,###.00" ); // data is "1.234,56" (European)
// after
field.setFormat( "#.##0,00" ); // match the locale of the source data
Defensive patterns

Strategy: try-catch

Validate before calling

// Java API: test field extraction on a sample document before the run
Node n = XPathFactory.newInstance().newXPath().evaluate( xpathExpr, doc, XPathConstants.NODE );
if ( n == null ) { throw new IllegalStateException( "XPath returns nothing: " + xpathExpr ); }

Try / catch

stepMeta.setStepErrorHandling( errorHandling ); // send rows to error stream; read putError code "GetXMLData001" + e.toString() to find the bad field

Prevention

When it happens

Trigger: processPutRow catch block: field value conversion/extraction fails, e.g. XPath returns incompatible content, a field format (date/number mask) fails to parse, or substituteToken/field mapping throws.

Common situations: Date/number conversion masks that do not match actual data ('Format' tab), XPath fields resolving to nodes with unexpected content, nulls where a type conversion is expected.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLData.java:882

      if ( irow == null ) {
        data.previousRow = outputRowData;
      } else {
        // clone to previously allocated array to make sure next step doesn't
        // change it in between...
        System.arraycopy( outputRowData, 0, this.prevRow, 0, outputRowData.length );
        // Pick up everything else that needs a real deep clone
        data.previousRow = irow.cloneRow( outputRowData, this.prevRow );
      }
    } catch ( Exception e ) {
      if ( getStepMeta().isDoingErrorHandling() ) {
        // Simply add this row to the error row
        putError( data.outputRowMeta, outputRowData, 1, e.toString(), null, "GetXMLData001" );
        data.errorInRowButContinue = true;
        return null;
      } else {
        logError( e.toString() );
        throw new KettleException( e.toString() );
      }
    }
    return outputRowData;
  }

  public String substituteToken( String aString, Object[] outputRowData ) {
    if ( aString == null ) {
      return null;
    }

    StringBuilder buffer = new StringBuilder();

    String rest = aString;

    // search for closing string
    int i = rest.indexOf( data.tokenStart );
    while ( i > -1 ) {
      int j = rest.indexOf( data.tokenEnd, i + data.tokenStart.length() );

View on GitHub (pinned to f3058517a1)