pentaho/pentaho-kettle · error · RuntimeException

e (wrapped exception)

Error message

e (wrapped exception)

What it means

In streaming mode, GetXMLData's onEnd callback processes each matched row via processStreaming(row). If processStreaming throws (e.g. a KettleException from applyXPath inside), it is rethrown wrapped in a RuntimeException so the SAX content handler can propagate it. The underlying cause is the actual step failure.

Solutions

  1. Unwrap and inspect e.getCause() for the underlying KettleException message
  2. Verify the XPath / loop XPath expressions are valid against a sample document
  3. Test the same file in non-streaming mode to isolate streaming-specific issues
  4. Check the XML's namespaces and adjust the XPath (or enable namespace handling) accordingly

Example fix

// before
catch (RuntimeException re) { logError(re.getMessage()); }
// after
catch (RuntimeException re) { logError("Streaming row processing failed", re); logError("Cause:", re.getCause()); }
Defensive patterns

Strategy: try-catch

Validate before calling

// validate XPath before running streaming mode
try { org.dom4j.DocumentHelper.createXPath(loopXPath); }
catch (Exception e) { failFast("Invalid loop XPath: " + loopXPath); }

Try / catch

try { runTransformation(); }
catch (RuntimeException re) {
  Throwable cause = re.getCause();
  if (cause instanceof KettleException) logError("Streaming step failed: " + cause.getMessage(), cause);
}

Prevention

When it happens

Trigger: Streaming-mode XML input where a matched node fails processing — typically applyXPath failing or row field extraction erroring inside processStreaming, triggered during SAX end-of-element handling.

Common situations: Invalid XPath expression in step settings; XML document structure not matching the loop path; namespace-prefixed XPath on documents without namespace awareness.

Related errors


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

Appendix: source

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

              }
              data.stopPruning = true;
              path.getCurrent().getDocument().detach(); // trick to stop reader
              return;
            }

            // process a ROW element
            if ( log.isDebug() ) {
              logDebug( BaseMessages.getString( PKG, "GetXMLData.Log.StreamingMode.StartProcessing" ) );
            }
            Element row = path.getCurrent();
            try {
              // Pass over the row instead of just the document. If
              // if there's only one row, there's no need to
              // go back to the whole document.
              processStreaming( row );
            } catch ( Exception e ) {
              // catch the KettleException or others and forward to caller, e.g. when applyXPath() has a problem
              throw new RuntimeException( e );
            }
            // prune the tree
            row.detach();
            if ( log.isDebug() ) {
              logDebug( BaseMessages.getString( PKG, "GetXMLData.Log.StreamingMode.EndProcessing" ) );
            }
          }
        } );
      }

      if ( IsInXMLField ) {
        // read string to parse
        data.document = reader.read( new StringReader( StringXML ) );
      } else if ( readurl && KettleVFS.startsWithScheme( StringXML ) ) {
        data.document = reader.read( KettleVFS.getInstance( getTransMeta().getBowl() ).getInputStream( StringXML ) );
      } else if ( readurl ) {
        // read url as source
        HttpClient client = HttpClientManager.getInstance().createDefaultClient();

View on GitHub (pinned to f3058517a1)