pentaho/pentaho-kettle · error · InvocationTargetException

GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScann…

Error message

GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScanningFile

What it means

Thrown (as an InvocationTargetException) by LoopNodesImportProgressDialog.run when doScan fails while scanning an XML file for candidate loop/XPath nodes. The dialog wraps any exception from the scan into an InvocationTargetException whose message is the localized 'ErrorScanningFile' text including the filename and e.toString(). The user sees this in the import-progress dialog when populating loop paths from a sample file.

Solutions

  1. Open the file named in the message in an XML editor to confirm it is well-formed
  2. Check the wrapped cause (e.toString() is embedded in the message) for the parser error and line number
  3. Re-save/normalize the file's encoding to UTF-8 and retry the scan

Example fix

// before
<b><a>text</b></a> // malformed nesting
// after
<b><a>text</a></b>
Defensive patterns

Strategy: validation

Validate before calling

// Validate the sample XML before running the import scan
try (Reader r = Files.newBufferedReader(Paths.get(filename), StandardCharsets.UTF_8)) {
    DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(r));
} // parse throws => fix file before scanning

Try / catch

try {
    progressDialog.open();
} catch (InvocationTargetException e) {
    log.error("Scan failed for " + filename + ": " + e.getCause());
    // fix the XML document, then rerun the import
}

Prevention

When it happens

Trigger: doScan throws while parsing the sample XML: malformed XML, unreadable file, encoding errors, or XPath evaluation failures during node enumeration on the file named in the message.

Common situations: Pointing the import dialog at a non-XML or corrupt file; wrong encoding (e.g. UTF-16 file read as UTF-8); very large files timing out; restricted characters in the document.

Related errors


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

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/ui/trans/steps/getxmldata/LoopNodesImportProgressDialog.java:104

    this.listpath = new ArrayList<String>();
    this.nr = 0;
    if ( useUrl ) {
      this.xml = null;
      this.url = xmlSource;
    } else {
      this.xml = xmlSource;
      this.url = null;
    }
  }

  public String[] open( Bowl bowl ) {
    IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
        try {
          Xpaths = doScan( bowl, monitor );
        } catch ( Exception e ) {
          e.printStackTrace();
          throw new InvocationTargetException( e, BaseMessages.getString( PKG,
              "GetXMLDateLoopNodesImportProgressDialog.Exception.ErrorScanningFile", filename, e.toString() ) );
        }
      }
    };

    try {
      ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell );
      pmd.run( true, true, op );
    } catch ( InvocationTargetException e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Title" ), BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Message" ), e );
    } catch ( InterruptedException e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Title" ), BaseMessages.getString( PKG,
          "GetXMLDateLoopNodesImportProgressDialog.ErrorScanningFile.Message" ), e );
    }

View on GitHub (pinned to f3058517a1)