{"record":{"id":"4e96191f97f135be","repo":"pentaho/pentaho-kettle","slug":"e-wrapped-exception-getxmldata","errorCode":null,"errorMessage":"e (wrapped exception)","messagePattern":"e \\(wrapped exception\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLData.java","lineNumber":145,"sourceCode":"              }\n              data.stopPruning = true;\n              path.getCurrent().getDocument().detach(); // trick to stop reader\n              return;\n            }\n\n            // process a ROW element\n            if ( log.isDebug() ) {\n              logDebug( BaseMessages.getString( PKG, \"GetXMLData.Log.StreamingMode.StartProcessing\" ) );\n            }\n            Element row = path.getCurrent();\n            try {\n              // Pass over the row instead of just the document. If\n              // if there's only one row, there's no need to\n              // go back to the whole document.\n              processStreaming( row );\n            } catch ( Exception e ) {\n              // catch the KettleException or others and forward to caller, e.g. when applyXPath() has a problem\n              throw new RuntimeException( e );\n            }\n            // prune the tree\n            row.detach();\n            if ( log.isDebug() ) {\n              logDebug( BaseMessages.getString( PKG, \"GetXMLData.Log.StreamingMode.EndProcessing\" ) );\n            }\n          }\n        } );\n      }\n\n      if ( IsInXMLField ) {\n        // read string to parse\n        data.document = reader.read( new StringReader( StringXML ) );\n      } else if ( readurl && KettleVFS.startsWithScheme( StringXML ) ) {\n        data.document = reader.read( KettleVFS.getInstance( getTransMeta().getBowl() ).getInputStream( StringXML ) );\n      } else if ( readurl ) {\n        // read url as source\n        HttpClient client = HttpClientManager.getInstance().createDefaultClient();","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLData.java#L127-L163","documentation":"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.","triggerScenarios":"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.","commonSituations":"Invalid XPath expression in step settings; XML document structure not matching the loop path; namespace-prefixed XPath on documents without namespace awareness.","solutions":["Unwrap and inspect e.getCause() for the underlying KettleException message","Verify the XPath / loop XPath expressions are valid against a sample document","Test the same file in non-streaming mode to isolate streaming-specific issues","Check the XML's namespaces and adjust the XPath (or enable namespace handling) accordingly"],"exampleFix":"// before\ncatch (RuntimeException re) { logError(re.getMessage()); }\n// after\ncatch (RuntimeException re) { logError(\"Streaming row processing failed\", re); logError(\"Cause:\", re.getCause()); }","handlingStrategy":"try-catch","validationCode":"// validate XPath before running streaming mode\ntry { org.dom4j.DocumentHelper.createXPath(loopXPath); }\ncatch (Exception e) { failFast(\"Invalid loop XPath: \" + loopXPath); }","typeGuard":null,"tryCatchPattern":"try { runTransformation(); }\ncatch (RuntimeException re) {\n  Throwable cause = re.getCause();\n  if (cause instanceof KettleException) logError(\"Streaming step failed: \" + cause.getMessage(), cause);\n}","preventionTips":["Test XPath expressions on sample files before streaming runs","Match file structure to the configured loop path","Fall back to non-streaming mode when documents are small"],"tags":["xml","xpath","streaming","wrapped-exception"],"backgroundTag":"xml-transform-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}